diff options
| author | Misko Hevery | 2011-11-08 17:40:03 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-11-14 20:31:15 -0800 |
| commit | 085e3c611fd0cd48757702c50c67b551a00a0d38 (patch) | |
| tree | 879f19d0a829c828c3636b38c8c422f732a829a9 /src/directives.js | |
| parent | 4b35a59c6afd5093ed5ce7d68b75ccadd4c53696 (diff) | |
| download | angular.js-085e3c611fd0cd48757702c50c67b551a00a0d38.tar.bz2 | |
new(directive): added ng:module directive for loading modules
Diffstat (limited to 'src/directives.js')
| -rw-r--r-- | src/directives.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/directives.js b/src/directives.js index b511541f..9361f08f 100644 --- a/src/directives.js +++ b/src/directives.js @@ -690,8 +690,7 @@ angularDirective("ng:class-odd", ngClass(function(i){return i % 2 === 0;})); <doc:source> <ol ng:init="names=['John', 'Mary', 'Cate', 'Suz']"> <li ng:repeat="name in names"> - <span ng:class-odd="'ng-format-negative'" - ng:class-even="'ng-input-indicator-wait'"> + <span ng:class-odd="'odd'" ng:class-even="'even'"> {{name}} </span> </li> @@ -700,9 +699,9 @@ angularDirective("ng:class-odd", ngClass(function(i){return i % 2 === 0;})); <doc:scenario> it('should check ng:class-odd and ng:class-even', function() { expect(element('.doc-example-live li:first span').prop('className')). - toMatch(/ng-format-negative/); + toMatch(/odd/); expect(element('.doc-example-live li:last span').prop('className')). - toMatch(/ng-input-indicator-wait/); + toMatch(/even/); }); </doc:scenario> </doc:example> @@ -888,3 +887,12 @@ angularDirective("ng:cloak", function(expression, element) { element.removeAttr('ng:cloak'); element.removeClass('ng-cloak'); }); + +angularDirective('ng:module', ['$value', '$injector', + function(modules, $injector) { + forEach(modules.split(','), function(module){ + if (module = trim(module)) { + $injector.loadModule(module); + } + }); +}]); |
