Skip to content

Commit d640c11

Browse files
committed
Preparing for next release
1 parent fbdd9de commit d640c11

File tree

7 files changed

+55
-26
lines changed

7 files changed

+55
-26
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
components
33
.DS_Store
4+
.idea

README.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,44 @@ AngularCSS listens for [route](https://github.com/angular/bower-angular-route) (
77

88
##### Read the Article
99

10-
[Introducing AngularCSS: CSS On-Demand for AngularJS](http://door3.com/insights/introducing-angularcss-css-demand-angularjs)
10+
[Introducing AngularCSS: CSS On-Demand for AngularJS](http://www.castillo.io/blog/2015/2/1/introducing-angularcss-css-on-demand-for-angularjs)
1111

1212
### Demos
1313

14-
[Angular's ngRoute Demo](http://door3.github.io/angular-css) ([source](../gh-pages/app.routes.js))
14+
[Angular's ngRoute Demo](http://castillo-io.github.io/angular-css) ([source](../gh-pages/app.routes.js))
1515

16-
[UI Router Demo](http://door3.github.io/angular-css/states.html) ([source](../gh-pages/app.states.js))
16+
[UI Router Demo](http://castillo-io.github.io/angular-css/states.html) ([source](../gh-pages/app.states.js))
1717

1818

1919
### Quick Start
2020

21-
Install and manage with [Bower](http://bower.io). A [CDN](http://cdnjs.com/libraries/angular-css) is also provided by cdnjs.com
21+
Install and manage with [Bower](http://bower.io) or [jspm](http://jspm.io). A [CDN](http://cdnjs.com/libraries/angular-css) is also provided by cdnjs.com
2222

2323
``` bash
2424
$ bower install angular-css
2525
```
2626

27+
``` bash
28+
$ jspm install github:castillo-io/angular-css
29+
```
30+
2731

2832
1) Include the required JavaScript libraries in your `index.html` (ngRoute and UI Router are optional).
2933

3034
``` html
31-
<script src="/libs/angularjs/1.3.7/angular.min.js"></script>
32-
<script src="/libs/angularjs/1.3.7/angular-routes.min.js"></script>
35+
<script src="/libs/angularjs/1.5.3/angular.min.js"></script>
36+
<script src="/libs/angularjs/1.5.3/angular-routes.min.js"></script>
3337
<script src="/libs/angular-css/angular-css.min.js"></script>
3438
```
3539

36-
2) Add `door3.css` as a dependency for your app.
40+
2) Add `angularCSS` as a dependency for your app.
3741

3842
``` js
39-
var myApp = angular.module('myApp', ['ngRoute','door3.css']);
43+
var myApp = angular.module('myApp', ['ngRoute','angularCSS']);
4044
```
4145

46+
NOTE: The module name "door3.css" is now deprecated.
47+
4248
### Examples
4349

4450
This module can be used by adding a css property in your routes values, directives or by calling the `$css` service methods from controllers and services.
@@ -47,6 +53,14 @@ The css property supports a string, an array of strings, object notation or an a
4753

4854
See examples below for more information.
4955

56+
#### In Components
57+
58+
``` js
59+
myApp.component('myComponent', {
60+
css: 'my-component/my-component.css' // <--- magic!
61+
templateUrl: 'my-component/my-component.html',
62+
});
63+
```
5064

5165
#### In Directives
5266

@@ -240,7 +254,7 @@ $routeProvider
240254
});
241255
```
242256

243-
Even though you can use the `media` property to specify media queries, the best way to manage your breakpoins is by settings them in the provider's defaults. For example:
257+
Even though you can use the `media` property to specify media queries, the best way to manage your breakpoints is by settings them in the provider's defaults. For example:
244258

245259
```js
246260
myApp.config(function($routeProvider, $cssProvider) {
@@ -316,9 +330,10 @@ css: {
316330
### Support
317331

318332
AngularCSS is fully supported by AngularJS 1.3+
333+
Now added AngularJS 1.5 support for .component()
319334

320335
There is partial support for AngularJS 1.2. It does not support `css` property via DDO (Directive Definition Object).
321-
The workarond is to bind (or add) the CSS in the directive's controller or link function via `$css` service.
336+
The workaround is to bind (or add) the CSS in the directive's controller or link function via `$css` service.
322337

323338
``` js
324339
myApp.directive('myDirective', function () {
@@ -332,6 +347,19 @@ myApp.directive('myDirective', function () {
332347
});
333348
```
334349

350+
### Angular 2
351+
352+
Can I use AngularCSS in Angular 2?
353+
354+
AngularCSS is not necessary in Angular 2! Angular 2 ships with a similar feature out of the box. It's called 'styleUrls' and it looks like this:
355+
356+
``` js
357+
@Component({
358+
selector: 'my-component',
359+
templateUrl: 'app/components/my-component/my-component.html',
360+
styleUrls: ['app/components/my-component/my-component.css'],
361+
})
362+
``
335363

336364
#### Browsers
337365

@@ -349,7 +377,7 @@ Please submit all pull requests the against master branch. If your pull request
349377
```
350378
The MIT License
351379
352-
Copyright (c) 2014 DOOR3, Alex Castillo
380+
Copyright (c) 2016 Alex Castillo
353381
354382
Permission is hereby granted, free of charge, to any person obtaining a copy
355383
of this software and associated documentation files (the "Software"), to deal

angular-css.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* AngularCSS - CSS on-demand for AngularJS
3-
* @version v1.0.7
4-
* @author DOOR3, Alex Castillo
5-
* @link http://door3.github.io/angular-css
3+
* @version v1.0.8
4+
* @author Alex Castillo
5+
* @link http://castillo-io.github.io/angular-css
66
* @license MIT License, http://www.opensource.org/licenses/MIT
77
*/
88

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "angular-css",
33
"main": "./angular-css.js",
4-
"version": "1.0.7",
5-
"homepage": "http://door3.github.io/angular-css",
4+
"version": "1.0.8",
5+
"homepage": "http://castillo-io.github.io/angular-css",
66
"authors": [
77
"Alex Castillo <[email protected]>"
88
],
@@ -18,7 +18,7 @@
1818
},
1919
"repository": {
2020
"type": "git",
21-
"url": "git://github.com/door3/angular-css"
21+
"url": "git://github.com/castillo-io/angular-css"
2222
},
2323
"license": "MIT",
2424
"ignore": [

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
require('./angular-css.js');
2-
module.exports = 'door3.css';
2+
module.exports = 'angularCSS';

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"name": "angular-css",
33
"filename": "angular-css.js",
44
"description": "CSS on-demand for AngularJS",
5-
"version": "1.0.7",
6-
"homepage": "http://door3.github.io/angular-css",
5+
"version": "1.0.8",
6+
"homepage": "http://castillo.github.io/angular-css",
77
"repository": {
88
"type": "git",
9-
"url": "git://github.com/door3/angular-css"
9+
"url": "git://github.com/castillo-io/angular-css"
1010
},
1111
"npmName": "angular-css",
1212
"npmFileMap": [
@@ -25,7 +25,7 @@
2525
"licenses": [
2626
{
2727
"type": "MIT",
28-
"url": "https://github.com/door3/angular-css/blob/master/LICENSE.txt"
28+
"url": "https://github.com/castillo-io/angular-css/blob/master/LICENSE.txt"
2929
}
3030
],
3131
"keywords": [
@@ -36,14 +36,14 @@
3636
],
3737
"autoupdate": {
3838
"source": "git",
39-
"target": "git://github.com/door3/angular-css",
39+
"target": "git://github.com/castillo-io/angular-css",
4040
"basePath": "/",
4141
"files": [
4242
"*.js"
4343
]
4444
},
4545
"bugs": {
46-
"url": "https://github.com/door3/angular-css/issues"
46+
"url": "https://github.com/castillo-io/angular-css/issues"
4747
},
4848
"main": "index.js",
4949
"license": "MIT",

test/spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

3-
describe('door3.css', function () {
3+
describe('angularCSS', function () {
44

55
var expect = chai.expect;
66

7-
beforeEach(module('door3.css'));
7+
beforeEach(module('angularCSS'));
88

99
it('should contain $css service', inject (function($css) {
1010
expect($css).not.to.equal(null);

0 commit comments

Comments
 (0)