aboutsummaryrefslogtreecommitdiffstats
path: root/src/directives.js
diff options
context:
space:
mode:
authorMisko Hevery2011-11-08 17:40:03 -0800
committerMisko Hevery2011-11-14 20:31:15 -0800
commit085e3c611fd0cd48757702c50c67b551a00a0d38 (patch)
tree879f19d0a829c828c3636b38c8c422f732a829a9 /src/directives.js
parent4b35a59c6afd5093ed5ce7d68b75ccadd4c53696 (diff)
downloadangular.js-085e3c611fd0cd48757702c50c67b551a00a0d38.tar.bz2
new(directive): added ng:module directive for loading modules
Diffstat (limited to 'src/directives.js')
-rw-r--r--src/directives.js16
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}} &nbsp; &nbsp; &nbsp;
</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);
+ }
+ });
+}]);