aboutsummaryrefslogtreecommitdiffstats
path: root/test/directivesSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2010-03-23 14:57:11 -0700
committerMisko Hevery2010-03-23 14:57:11 -0700
commitbb98ae14f2aef74efbd8345e93f62ac67f460f7f (patch)
treeb50ac4417c7b1bda996dd569069d7eb834eef2ff /test/directivesSpec.js
parent6ff550cfa9524bbb124d10caf1fc13c911ab3b4b (diff)
downloadangular.js-bb98ae14f2aef74efbd8345e93f62ac67f460f7f.tar.bz2
markup now wroks, some refactorings
Diffstat (limited to 'test/directivesSpec.js')
-rw-r--r--test/directivesSpec.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index d125d326..18bedb64 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -3,7 +3,7 @@ describe("directives", function(){
var compile, element;
beforeEach(function() {
- var compiler = new Compiler(angularMarkup, angularDirective, angularWidget);
+ var compiler = new Compiler(angularTextMarkup, angularAttrMarkup, angularDirective, angularWidget);
compile = function(html) {
element = jqLite(html);
var view = compiler.compile(element)(element);
@@ -39,6 +39,14 @@ describe("directives", function(){
expect(element.text()).toEqual('misko');
});
+ it('should ng-bind-template', function() {
+ var scope = compile('<div ng-bind-template="Hello {{name}}!"></div>');
+ expect(element.text()).toEqual('');
+ scope.set('name', 'Misko');
+ scope.updateView();
+ expect(element.text()).toEqual('Hello Misko!');
+ });
+
it('should ng-bind-attr', function(){
var scope = compile('<img ng-bind-attr="{src:\'mysrc\', alt:\'myalt\'}"/>');
expect(element.attr('src')).toEqual(null);
@@ -81,7 +89,7 @@ describe("directives", function(){
it('should error on wrong parsing of ng-repeat', function(){
var scope = compile('<ul><li ng-repeat="i dont parse"></li></ul>');
var log = "";
- element.eachNode(function(li){
+ eachNode(element, function(li){
log += li.attr('ng-error') + ';';
log += li.hasClass('ng-exception') + ';';
});