From 1f0562150921ea2f05149b64ef0440937491def9 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 2 Jul 2010 15:39:47 -0700 Subject: change all attributes from ng- to ng: prefix --- example/memoryLeak.html | 4 +- example/tweeter/tweeter_addressbook.html | 30 +++---- example/tweeter/tweeter_demo.html | 10 +-- scenario/application-account.html | 4 +- scenario/application.html | 6 +- scenario/cross-site-post/index.html | 2 +- scenario/datastore.html | 4 +- scenario/perf.html | 6 +- scenario/widgets.html | 6 +- src/Compiler.js | 4 +- src/delete/Binder.js | 76 ++++++++-------- src/delete/Widgets.js | 4 +- src/directives.js | 40 ++++----- src/markups.js | 28 +++--- src/moveToAngularCom/ControlBar.js | 4 +- src/widgets.js | 8 +- test.sh | 9 +- test/BinderTest.js | 148 +++++++++++++++---------------- test/ScenarioSpec.js | 2 +- test/delete/WidgetsTest.js | 2 +- test/directivesSpec.js | 90 +++++++++---------- test/markupSpec.js | 10 +-- test/moveToAngularCom/miscTest.js | 6 +- test/testabilityPatch.js | 4 +- test/widgetsSpec.js | 8 +- 25 files changed, 260 insertions(+), 255 deletions(-) diff --git a/example/memoryLeak.html b/example/memoryLeak.html index 9e5f512d..19b0d45d 100644 --- a/example/memoryLeak.html +++ b/example/memoryLeak.html @@ -48,8 +48,8 @@ - - + +
diff --git a/example/tweeter/tweeter_addressbook.html b/example/tweeter/tweeter_addressbook.html index 4844c035..ba915cb1 100644 --- a/example/tweeter/tweeter_addressbook.html +++ b/example/tweeter/tweeter_addressbook.html @@ -8,25 +8,25 @@ - +

Address Book

[ Filter: ]
-
+
@@ -37,7 +37,7 @@ - +

@@ -58,16 +58,16 @@ tweets={{tweets}}

Tweets: {{$anchor.user}}

[ Filter: - | << All + | << All ]
Loading...
    -
  • +
  • - [ {{user.nickname || user.name || user.screen_name }} - | + + [ {{user.nickname || user.name || user.screen_name }} + | + ]: {{tweet.text | linky}} {{tweet.created_at}} diff --git a/example/tweeter/tweeter_demo.html b/example/tweeter/tweeter_demo.html index 138d4e2b..a5ba95ba 100644 --- a/example/tweeter/tweeter_demo.html +++ b/example/tweeter/tweeter_demo.html @@ -8,19 +8,19 @@ - + (TODO: I should fetch current tweets)

    Tweets: {{$anchor.user}}

    [ Filter: (TODO: this should act as search box) - | << All + | << All ]
    Loading...
      -
    • +
    • - [ {{tweet.user.nickname || tweet.user.name || tweet.user.screen_name }} + [ {{tweet.user.nickname || tweet.user.name || tweet.user.screen_name }} ]: {{tweet.text}} (TODO: I want urls as links) {{tweet.created_at}} diff --git a/scenario/application-account.html b/scenario/application-account.html index a43deffc..81176df7 100644 --- a/scenario/application-account.html +++ b/scenario/application-account.html @@ -1,6 +1,6 @@ -
      +
      account page goes here! - +
      diff --git a/scenario/application.html b/scenario/application.html index 6b6ced69..5d5bb809 100644 --- a/scenario/application.html +++ b/scenario/application.html @@ -16,14 +16,14 @@ - + [ login | account ] -
      login screen
      - +
      login screen
      +
      diff --git a/scenario/cross-site-post/index.html b/scenario/cross-site-post/index.html index 3ff6af85..d7a87d3b 100644 --- a/scenario/cross-site-post/index.html +++ b/scenario/cross-site-post/index.html @@ -4,7 +4,7 @@ - +
      people = {{people}}
      diff --git a/scenario/datastore.html b/scenario/datastore.html index 525d3636..1720b3bc 100644 --- a/scenario/datastore.html +++ b/scenario/datastore.html @@ -8,9 +8,9 @@ $(document).ready(function(){angular.compile(document).init();}); - +

      {{book.$id}}

      -
    • +
    • {{book.name}}
    • diff --git a/scenario/perf.html b/scenario/perf.html index 50a8d28f..94af8b69 100644 --- a/scenario/perf.html +++ b/scenario/perf.html @@ -20,12 +20,12 @@ }; - +
      diff --git a/scenario/widgets.html b/scenario/widgets.html index 86269e86..2626843d 100644 --- a/scenario/widgets.html +++ b/scenario/widgets.html @@ -72,7 +72,7 @@ Buttons - ng-change
      ng-click + ng-change
      ng:click

      @@ -85,10 +85,10 @@ Repeaters - ng-repeat + ng:repeat
        -
      • {{name}}
      • +
      • {{name}}
      diff --git a/src/Compiler.js b/src/Compiler.js index c8910c27..9faafb13 100644 --- a/src/Compiler.js +++ b/src/Compiler.js @@ -121,7 +121,7 @@ Compiler.prototype = { descend: function(value){ if(isDefined(value)) descend = value; return descend;}, directives: function(value){ if(isDefined(value)) directives = value; return directives;} }; - priority = element.attr('ng-eval-order') || priority || 0; + priority = element.attr('ng:eval-order') || priority || 0; if (isString(priority)) { priority = PRIORITY[uppercase(priority)] || 0; } @@ -200,7 +200,7 @@ function eachAttribute(element, fn){ var i, attrs = element[0].attributes || [], chld, attr, name, value, attrValue = {}; for (i = 0; i < attrs.length; i++) { attr = attrs[i]; - name = attr.name.replace(':', '-'); + name = attr.name; value = attr.value; if (msie && name == 'href') { value = decodeURIComponent(element[0].getAttribute(name, 2)); diff --git a/src/delete/Binder.js b/src/delete/Binder.js index 9fc32513..095e2b08 100644 --- a/src/delete/Binder.js +++ b/src/delete/Binder.js @@ -112,24 +112,24 @@ Binder.prototype = { }, executeInit: function() { - this.docFindWithSelf("[ng-init]").each(function() { + this.docFindWithSelf("[ng:init]").each(function() { var jThis = jQuery(this); var scope = jThis.scope(); try { - scope.eval(jThis.attr('ng-init')); + scope.eval(jThis.attr('ng:init')); } catch (e) { - alert("EVAL ERROR:\n" + jThis.attr('ng-init') + '\n' + toJson(e, true)); + alert("EVAL ERROR:\n" + jThis.attr('ng:init') + '\n' + toJson(e, true)); } }); }, entity: function (scope) { var self = this; - this.docFindWithSelf("[ng-entity]").attr("ng-watch", function() { + this.docFindWithSelf("[ng-entity]").attr("ng:watch", function() { try { var jNode = jQuery(this); var decl = scope.entity(jNode.attr("ng-entity"), self.datastore); - return decl + (jNode.attr('ng-watch') || ""); + return decl + (jNode.attr('ng:watch') || ""); } catch (e) { log(e); alert(e); @@ -142,7 +142,7 @@ Binder.prototype = { if (this.config['autoSubmit']) { var submits = this.docFindWithSelf(":submit").not("[ng-action]"); submits.attr("ng-action", "$save()"); - submits.not(":disabled").not("ng-bind-attr").attr("ng-bind-attr", '{disabled:"{{$invalidWidgets}}"}'); + submits.not(":disabled").not("ng:bind-attr").attr("ng:bind-attr", '{disabled:"{{$invalidWidgets}}"}'); } this.precompile(this.doc)(this.doc, jNode.scope(), ""); this.docFindWithSelf("a[ng-action]").live('click', function (event) { @@ -168,9 +168,9 @@ Binder.prototype = { if (parts.length > 1 || Binder.binding(parts[0])) { var parent = node.parentNode; if (isLeafNode(parent)) { - parent.setAttribute('ng-bind-template', node.nodeValue); + parent.setAttribute('ng:bind-template', node.nodeValue); factories.push({path:path, fn:function(node, scope, prefix) { - return new BindUpdater(node, node.getAttribute('ng-bind-template')); + return new BindUpdater(node, node.getAttribute('ng:bind-template')); }}); } else { for (var i = 0; i < parts.length; i++) { @@ -180,7 +180,7 @@ Binder.prototype = { if (binding) { newNode = document.createElement("span"); var jNewNode = jQuery(newNode); - jNewNode.attr("ng-bind", binding); + jNewNode.attr("ng:bind", binding); if (i === 0) { factories.push({path:path.concat(offset + i), fn:this.ng_bind}); } @@ -228,13 +228,13 @@ Binder.prototype = { } if (!node.getAttribute) return; - var nonBindable = node.getAttribute('ng-non-bindable'); + var nonBindable = node.getAttribute('ng:non-bindable'); if (nonBindable || nonBindable === "") return; var attributes = node.attributes; if (attributes) { - var bindings = node.getAttribute('ng-bind-attr'); - node.removeAttribute('ng-bind-attr'); + var bindings = node.getAttribute('ng:bind-attr'); + node.removeAttribute('ng:bind-attr'); bindings = bindings ? fromJson(bindings) : {}; var attrLen = attributes.length; for (var i = 0; i < attrLen; i++) { @@ -249,23 +249,23 @@ Binder.prototype = { } var json = toJson(bindings); if (json.length > 2) { - node.setAttribute("ng-bind-attr", json); + node.setAttribute("ng:bind-attr", json); } } if (!node.getAttribute) log(node); - var repeaterExpression = node.getAttribute('ng-repeat'); + var repeaterExpression = node.getAttribute('ng:repeat'); if (repeaterExpression) { - node.removeAttribute('ng-repeat'); + node.removeAttribute('ng:repeat'); var precompiled = this.precompile(node); - var view = document.createComment("ng-repeat: " + repeaterExpression); + var view = document.createComment("ng:repeat: " + repeaterExpression); var parentNode = node.parentNode; parentNode.insertBefore(view, node); parentNode.removeChild(node); function template(childScope, prefix, i) { var clone = jQuery(node).clone(); clone.css('display', ''); - clone.attr('ng-repeat-index', "" + i); + clone.attr('ng:repeat-index', "" + i); clone.data('scope', childScope); precompiled(clone[0], childScope, prefix + i + ":"); return clone; @@ -276,16 +276,16 @@ Binder.prototype = { return; } - if (node.getAttribute('ng-eval')) factories.push({path:path, fn:this.ng_eval}); - if (node.getAttribute('ng-bind')) factories.push({path:path, fn:this.ng_bind}); - if (node.getAttribute('ng-bind-attr')) factories.push({path:path, fn:this.ng_bind_attr}); - if (node.getAttribute('ng-hide')) factories.push({path:path, fn:this.ng_hide}); - if (node.getAttribute('ng-show')) factories.push({path:path, fn:this.ng_show}); - if (node.getAttribute('ng-class')) factories.push({path:path, fn:this.ng_class}); - if (node.getAttribute('ng-class-odd')) factories.push({path:path, fn:this.ng_class_odd}); - if (node.getAttribute('ng-class-even')) factories.push({path:path, fn:this.ng_class_even}); - if (node.getAttribute('ng-style')) factories.push({path:path, fn:this.ng_style}); - if (node.getAttribute('ng-watch')) factories.push({path:path, fn:this.ng_watch}); + if (node.getAttribute('ng:eval')) factories.push({path:path, fn:this.ng_eval}); + if (node.getAttribute('ng:bind')) factories.push({path:path, fn:this.ng_bind}); + if (node.getAttribute('ng:bind-attr')) factories.push({path:path, fn:this.ng_bind_attr}); + if (node.getAttribute('ng:hide')) factories.push({path:path, fn:this.ng_hide}); + if (node.getAttribute('ng:show')) factories.push({path:path, fn:this.ng_show}); + if (node.getAttribute('ng:class')) factories.push({path:path, fn:this.ng_class}); + if (node.getAttribute('ng:class-odd')) factories.push({path:path, fn:this.ng_class_odd}); + if (node.getAttribute('ng:class-even')) factories.push({path:path, fn:this.ng_class_even}); + if (node.getAttribute('ng:style')) factories.push({path:path, fn:this.ng_style}); + if (node.getAttribute('ng:watch')) factories.push({path:path, fn:this.ng_watch}); var nodeName = node.nodeName; if ((nodeName == 'INPUT' ) || nodeName == 'TEXTAREA' || @@ -301,7 +301,7 @@ Binder.prototype = { var html = jQuery('' + + '' + '' + '' + '' + @@ -640,7 +640,7 @@ function RepeaterUpdater(view, repeaterExpression, template, prefix) { this.children = []; var match = repeaterExpression.match(/^\s*(.+)\s+in\s+(.*)\s*$/); if (! match) { - throw "Expected ng-repeat in form of 'item in collection' but got '" + + throw "Expected ng:repeat in form of 'item in collection' but got '" + repeaterExpression + "'."; } var keyValue = match[1]; diff --git a/src/directives.js b/src/directives.js index cabf0c23..1b422331 100644 --- a/src/directives.js +++ b/src/directives.js @@ -1,10 +1,10 @@ -angularDirective("ng-init", function(expression){ +angularDirective("ng:init", function(expression){ return function(element){ this.$tryEval(expression, element); }; }); -angularDirective("ng-controller", function(expression){ +angularDirective("ng:controller", function(expression){ return function(element){ var controller = getter(window, expression, true) || getter(this, expression, true); if (!controller) @@ -16,13 +16,13 @@ angularDirective("ng-controller", function(expression){ }; }); -angularDirective("ng-eval", function(expression){ +angularDirective("ng:eval", function(expression){ return function(element){ this.$onEval(expression, element); }; }); -angularDirective("ng-bind", function(expression){ +angularDirective("ng:bind", function(expression){ return function(element) { var lastValue = noop, lastError = noop; this.$onEval(function() { @@ -89,7 +89,7 @@ function compileBindTemplate(template){ return fn; } -angularDirective("ng-bind-template", function(expression){ +angularDirective("ng:bind-template", function(expression){ var templateFn = compileBindTemplate(expression); return function(element) { var lastValue; @@ -108,7 +108,7 @@ var REMOVE_ATTRIBUTES = { 'readonly':'readOnly', 'checked':'checked' }; -angularDirective("ng-bind-attr", function(expression){ +angularDirective("ng:bind-attr", function(expression){ return function(element){ var lastValue = {}; this.$onEval(function(){ @@ -134,17 +134,17 @@ angularDirective("ng-bind-attr", function(expression){ }; }); -angularWidget("@ng-non-bindable", noop); +angularWidget("@ng:non-bindable", noop); -angularWidget("@ng-repeat", function(expression, element){ - element.removeAttr('ng-repeat'); - element.replaceWith(this.comment("ng-repeat: " + expression)); +angularWidget("@ng:repeat", function(expression, element){ + element.removeAttr('ng:repeat'); + element.replaceWith(this.comment("ng:repeat: " + expression)); var template = this.compile(element); return function(reference){ var match = expression.match(/^\s*(.+)\s+in\s+(.*)\s*$/), lhs, rhs, valueIdent, keyIdent; if (! match) { - throw "Expected ng-repeat in form of 'item in collection' but got '" + + throw "Expected ng:repeat in form of 'item in collection' but got '" + expression + "'."; } lhs = match[1]; @@ -176,7 +176,7 @@ angularWidget("@ng-repeat", function(expression, element){ if (keyIdent) childScope[keyIdent] = key; lastElement.after(childScope.$element); childScope.$index = index; - childScope.$element.attr('ng-repeat-index', index); + childScope.$element.attr('ng:repeat-index', index); childScope.$init(); children.push(childScope); } @@ -192,7 +192,7 @@ angularWidget("@ng-repeat", function(expression, element){ }; }); -angularDirective("ng-click", function(expression, element){ +angularDirective("ng:click", function(expression, element){ return function(element){ var self = this; element.bind('click', function(){ @@ -203,7 +203,7 @@ angularDirective("ng-click", function(expression, element){ }; }); -angularDirective("ng-watch", function(expression, element){ +angularDirective("ng:watch", function(expression, element){ return function(element){ var self = this; new Parser(expression).watch()({ @@ -231,11 +231,11 @@ function ngClass(selector) { }; } -angularDirective("ng-class", ngClass(function(){return true;})); -angularDirective("ng-class-odd", ngClass(function(i){return i % 2 === 0;})); -angularDirective("ng-class-even", ngClass(function(i){return i % 2 === 1;})); +angularDirective("ng:class", ngClass(function(){return true;})); +angularDirective("ng:class-odd", ngClass(function(i){return i % 2 === 0;})); +angularDirective("ng:class-even", ngClass(function(i){return i % 2 === 1;})); -angularDirective("ng-show", function(expression, element){ +angularDirective("ng:show", function(expression, element){ return function(element){ this.$onEval(function(){ element.css('display', toBoolean(this.$eval(expression)) ? '' : 'none'); @@ -243,7 +243,7 @@ angularDirective("ng-show", function(expression, element){ }; }); -angularDirective("ng-hide", function(expression, element){ +angularDirective("ng:hide", function(expression, element){ return function(element){ this.$onEval(function(){ element.css('display', toBoolean(this.$eval(expression)) ? 'none' : ''); @@ -251,7 +251,7 @@ angularDirective("ng-hide", function(expression, element){ }; }); -angularDirective("ng-style", function(expression, element){ +angularDirective("ng:style", function(expression, element){ return function(element){ this.$onEval(function(){ element.css(this.$eval(expression)); diff --git a/src/markups.js b/src/markups.js index 74b293b8..ac2b5636 100644 --- a/src/markups.js +++ b/src/markups.js @@ -32,14 +32,14 @@ angularTextMarkup('{{}}', function(text, textNode, parentElement) { self = this; if (hasBindings(bindings)) { if (isLeafNode(parentElement[0])) { - parentElement.attr('ng-bind-template', text); + parentElement.attr('ng:bind-template', text); } else { var cursor = textNode, newElement; foreach(parseBindings(text), function(text){ var exp = binding(text); if (exp) { newElement = self.element('span'); - newElement.attr('ng-bind', exp); + newElement.attr('ng:bind', exp); } else { newElement = self.text(text); } @@ -68,18 +68,18 @@ angularTextMarkup('OPTION', function(text, textNode, parentElement){ } }); -var NG_BIND_ATTR = 'ng-bind-attr'; +var NG_BIND_ATTR = 'ng:bind-attr'; angularAttrMarkup('{{}}', function(value, name, element){ - if (name.substr(0, 3) != 'ng-') { - if (msie && name == 'src') - value = decodeURI(value); - var bindings = parseBindings(value), - bindAttr; - if (hasBindings(bindings)) { - element.removeAttr(name); - bindAttr = fromJson(element.attr(NG_BIND_ATTR) || "{}"); - bindAttr[name] = value; - element.attr(NG_BIND_ATTR, toJson(bindAttr)); - } + // don't process existing attribute markup + if (angularDirective(name) || angularDirective("@" + name)) return; + if (msie && name == 'src') + value = decodeURI(value); + var bindings = parseBindings(value), + bindAttr; + if (hasBindings(bindings)) { + element.removeAttr(name); + bindAttr = fromJson(element.attr(NG_BIND_ATTR) || "{}"); + bindAttr[name] = value; + element.attr(NG_BIND_ATTR, toJson(bindAttr)); } }); diff --git a/src/moveToAngularCom/ControlBar.js b/src/moveToAngularCom/ControlBar.js index 685beeb2..b9a2de8a 100644 --- a/src/moveToAngularCom/ControlBar.js +++ b/src/moveToAngularCom/ControlBar.js @@ -9,14 +9,14 @@ function ControlBar(document, serverUrl, database) { ControlBar.HTML = '
      ' + '
      ' + - '
      ' + + '
      ' + '' + '
      ' + '
      '; ControlBar.FORBIDEN = - '
      ' + + '
      ' + 'Sorry, you do not have permission for this!'+ '
      '; diff --git a/src/widgets.js b/src/widgets.js index efafa9c5..94f09c7b 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -196,7 +196,7 @@ function inputWidget(events, modelAccessor, viewAccessor, initFn) { action = element.attr('ng-change') || '', lastValue; initFn.call(scope, model, view, element); - this.$eval(element.attr('ng-init')||''); + this.$eval(element.attr('ng:init')||''); // Don't register a handler if we are a button (noopAccessor) and there is no action if (action || modelAccessor !== noopAccessor) { element.bind(events, function(){ @@ -236,11 +236,11 @@ angularWidget('NG:INCLUDE', function(element){ var compiler = this, srcExp = element.attr("src"), scopeExp = element.attr("scope") || ''; - if (element[0]['ng-compiled']) { + if (element[0]['ng:compiled']) { this.descend(true); this.directives(true); } else { - element[0]['ng-compiled'] = true; + element[0]['ng:compiled'] = true; return function(element){ var scope = this, childScope; var changeCounter = 0; @@ -276,7 +276,7 @@ var ngSwitch = angularWidget('NG:SWITCH', function (element){ cases = []; if (!usingFn) throw "Using expression '" + usingExpr + "' unknown."; eachNode(element, function(caseElement){ - var when = caseElement.attr('ng-switch-when'); + var when = caseElement.attr('ng:switch-when'); if (when) { cases.push({ when: function(scope, value){ diff --git a/test.sh b/test.sh index a1717861..d0a4839a 100755 --- a/test.sh +++ b/test.sh @@ -1,2 +1,7 @@ -java -jar lib/jstestdriver/JsTestDriver.jar --tests all -# java -jar lib/jstestdriver/JsTestDriver.jar --tests all --config jsTestDriver-jquery.conf +tests=$1 +if [[ $tests = "" ]]; then + tests="all" +fi + +java -jar lib/jstestdriver/JsTestDriver.jar --tests "$tests" +# java -jar lib/jstestdriver/JsTestDriver.jar --tests "$tests" --config jsTestDriver-jquery.conf diff --git a/test/BinderTest.js b/test/BinderTest.js index ecdd506f..6dc47cce 100644 --- a/test/BinderTest.js +++ b/test/BinderTest.js @@ -47,7 +47,7 @@ BinderTest.prototype.testChangingCheckboxUpdatesModel = function(){ }; BinderTest.prototype.testBindUpdate = function() { - var c = this.compile('
      '); + var c = this.compile('
      '); assertEquals(123, c.scope.$get('a')); }; @@ -71,26 +71,26 @@ BinderTest.prototype.testChangingSelectSelectedUpdatesModel = function(){ }; BinderTest.prototype.testExecuteInitialization = function() { - var c = this.compile('
      '); + var c = this.compile('
      '); assertEquals(c.scope.$get('a'), 123); }; BinderTest.prototype.testExecuteInitializationStatements = function() { - var c = this.compile('
      '); + var c = this.compile('
      '); assertEquals(c.scope.$get('a'), 123); assertEquals(c.scope.$get('b'), 345); }; BinderTest.prototype.testApplyTextBindings = function(){ - var form = this.compile('
      x
      '); + var form = this.compile('
      x
      '); form.scope.$set('model', {a:123}); form.scope.$eval(); assertEquals('123', form.node.text()); }; BinderTest.prototype.testReplaceBindingInTextWithSpan = function() { - assertEquals(this.compileToHtml("a{{b}}c"), 'ac'); - assertEquals(this.compileToHtml("{{b}}"), ''); + assertEquals(this.compileToHtml("a{{b}}c"), 'ac'); + assertEquals(this.compileToHtml("{{b}}"), ''); }; BinderTest.prototype.testBindingSpaceConfusesIE = function() { @@ -99,16 +99,16 @@ BinderTest.prototype.testBindingSpaceConfusesIE = function() { span.innerHTML = ' '; var nbsp = span.firstChild.nodeValue; assertEquals( - ''+nbsp+'', + ''+nbsp+'', this.compileToHtml("{{a}} {{b}}")); assertEquals( - ''+nbsp+'x '+nbsp+'()', + ''+nbsp+'x '+nbsp+'()', this.compileToHtml("{{A}} x {{B}} ({{C}})")); }; BinderTest.prototype.testBindingOfAttributes = function() { var c = this.compile(""); - var attrbinding = c.node.attr("ng-bind-attr"); + var attrbinding = c.node.attr("ng:bind-attr"); var bindings = fromJson(attrbinding); assertEquals("http://s/a{{b}}c", decodeURI(bindings.href)); assertTrue(!bindings.foo); @@ -116,7 +116,7 @@ BinderTest.prototype.testBindingOfAttributes = function() { BinderTest.prototype.testMarkMultipleAttributes = function() { var c = this.compile(''); - var attrbinding = c.node.attr("ng-bind-attr"); + var attrbinding = c.node.attr("ng:bind-attr"); var bindings = fromJson(attrbinding); assertEquals(bindings.foo, "{{d}}"); assertEquals(decodeURI(bindings.href), "http://s/a{{b}}c"); @@ -126,17 +126,17 @@ BinderTest.prototype.testAttributesNoneBound = function() { var c = this.compile(""); var a = c.node; assertEquals(a[0].nodeName, "A"); - assertTrue(!a.attr("ng-bind-attr")); + assertTrue(!a.attr("ng:bind-attr")); }; BinderTest.prototype.testExistingAttrbindingIsAppended = function() { - var c = this.compile(""); + var c = this.compile(""); var a = c.node; - assertEquals('{"b":"{{def}}","href":"http://s/{{abc}}"}', a.attr('ng-bind-attr')); + assertEquals('{"b":"{{def}}","href":"http://s/{{abc}}"}', a.attr('ng:bind-attr')); }; BinderTest.prototype.testAttributesAreEvaluated = function(){ - var c = this.compile(''); + var c = this.compile(''); var binder = c.binder, form = c.node; c.scope.$eval('a=1;b=2'); c.scope.$eval(); @@ -147,7 +147,7 @@ BinderTest.prototype.testAttributesAreEvaluated = function(){ BinderTest.prototype.testInputTypeButtonActionExecutesInScope = function(){ var savedCalled = false; - var c = this.compile(''); + var c = this.compile(''); c.scope.$set("person.save", function(){ savedCalled = true; }); @@ -157,7 +157,7 @@ BinderTest.prototype.testInputTypeButtonActionExecutesInScope = function(){ BinderTest.prototype.testInputTypeButtonActionExecutesInScope2 = function(){ var log = ""; - var c = this.compile(''); + var c = this.compile(''); c.scope.$set("action", function(){ log += 'click;'; }); @@ -168,7 +168,7 @@ BinderTest.prototype.testInputTypeButtonActionExecutesInScope2 = function(){ BinderTest.prototype.testButtonElementActionExecutesInScope = function(){ var savedCalled = false; - var c = this.compile(''); + var c = this.compile(''); c.scope.$set("person.save", function(){ savedCalled = true; }); @@ -177,7 +177,7 @@ BinderTest.prototype.testButtonElementActionExecutesInScope = function(){ }; BinderTest.prototype.testRepeaterUpdateBindings = function(){ - var a = this.compile('
      '); + var a = this.compile('
      '); var form = a.node; var items = [{a:"A"}, {a:"B"}]; a.scope.$set('model', {items:items}); @@ -185,25 +185,25 @@ BinderTest.prototype.testRepeaterUpdateBindings = function(){ a.scope.$eval(); assertEquals('
        ' + '<#comment>' + - '
      • A
      • ' + - '
      • B
      • ' + + '
      • A
      • ' + + '
      • B
      • ' + '
      ', sortedHtml(form)); items.unshift({a:'C'}); a.scope.$eval(); assertEquals('
        ' + '<#comment>' + - '
      • C
      • ' + - '
      • A
      • ' + - '
      • B
      • ' + + '
      • C
      • ' + + '
      • A
      • ' + + '
      • B
      • ' + '
      ', sortedHtml(form)); items.shift(); a.scope.$eval(); assertEquals('
        ' + '<#comment>' + - '
      • A
      • ' + - '
      • B
      • ' + + '
      • A
      • ' + + '
      • B
      • ' + '
      ', sortedHtml(form)); items.shift(); @@ -212,19 +212,19 @@ BinderTest.prototype.testRepeaterUpdateBindings = function(){ }; BinderTest.prototype.testRepeaterContentDoesNotBind = function(){ - var a = this.compile('
      '); + var a = this.compile('
      '); a.scope.$set('model', {items:[{a:"A"}]}); a.scope.$eval(); assertEquals('
        ' + '<#comment>' + - '
      • A
      • ' + + '
      • A
      • ' + '
      ', sortedHtml(a.node)); }; BinderTest.prototype.testExpandEntityTag = function(){ assertEquals( - '
      ', - this.compileToHtml('
      ')); + '
      ', + this.compileToHtml('
      ')); }; BinderTest.prototype.testDoNotOverwriteCustomAction = function(){ @@ -233,7 +233,7 @@ BinderTest.prototype.testDoNotOverwriteCustomAction = function(){ }; BinderTest.prototype.testRepeaterAdd = function(){ - var c = this.compile('
      '); + var c = this.compile('
      '); var doc = c.node; c.scope.$set('items', [{x:'a'}, {x:'b'}]); c.scope.$eval(); @@ -248,7 +248,7 @@ BinderTest.prototype.testRepeaterAdd = function(){ }; BinderTest.prototype.testItShouldRemoveExtraChildrenWhenIteratingOverHash = function(){ - var c = this.compile('
      {{i}}
      '); + var c = this.compile('
      {{i}}
      '); var items = {}; c.scope.$set("items", items); @@ -308,8 +308,8 @@ BinderTest.prototype.testIfAttrBindingThrowsErrorDecorateTheAttribute = function }; BinderTest.prototype.testNestedRepeater = function() { - var a = this.compile('
      ' + - '
        ' + + var a = this.compile('
        ' + + '
          ' + '
          '); a.scope.$set('model', [{name:'a', item:['a1', 'a2']}, {name:'b', item:['b1', 'b2']}]); @@ -317,20 +317,20 @@ BinderTest.prototype.testNestedRepeater = function() { assertEquals('
          '+ '<#comment>'+ - '
          '+ + '
          '+ '<#comment>'+ - '
            '+ - '
              '+ + '
                '+ + '
                  '+ '
                  '+ - '
                  '+ + '
                  '+ '<#comment>'+ - '
                    '+ - '
                      '+ + '
                        '+ + '
                          '+ '
                          ', sortedHtml(a.node)); }; BinderTest.prototype.testHideBindingExpression = function() { - var a = this.compile('
                          '); + var a = this.compile('
                          '); a.scope.$set('hidden', 3); a.scope.$eval(); @@ -344,7 +344,7 @@ BinderTest.prototype.testHideBindingExpression = function() { }; BinderTest.prototype.testHideBinding = function() { - var c = this.compile('
                          '); + var c = this.compile('
                          '); c.scope.$set('hidden', 'true'); c.scope.$eval(); @@ -363,7 +363,7 @@ BinderTest.prototype.testHideBinding = function() { }; BinderTest.prototype.testShowBinding = function() { - var c = this.compile('
                          '); + var c = this.compile('
                          '); c.scope.$set('show', 'true'); c.scope.$eval(); @@ -382,42 +382,42 @@ BinderTest.prototype.testShowBinding = function() { }; BinderTest.prototype.testBindClassUndefined = function() { - var doc = this.compile('
                          '); + var doc = this.compile('
                          '); doc.scope.$eval(); assertEquals( - '
                          ', + '
                          ', sortedHtml(doc.node)); }; BinderTest.prototype.testBindClass = function() { - var c = this.compile('
                          '); + var c = this.compile('
                          '); c.scope.$set('class', 'testClass'); c.scope.$eval(); assertEquals(sortedHtml(c.node), - '
                          '); + '
                          '); c.scope.$set('class', ['a', 'b']); c.scope.$eval(); assertEquals(sortedHtml(c.node), - '
                          '); + '
                          '); }; BinderTest.prototype.testBindClassEvenOdd = function() { - var x = this.compile('
                          '); + var x = this.compile('
                          '); x.scope.$eval(); assertEquals( '
                          <#comment>' + - '
                          ' + - '
                          ', + '
                          ' + + '
                          ', sortedHtml(x.node)); }; BinderTest.prototype.testBindStyle = function() { - var c = this.compile('
                          '); + var c = this.compile('
                          '); c.scope.$eval('style={color:"red"}'); c.scope.$eval(); @@ -430,7 +430,7 @@ BinderTest.prototype.testBindStyle = function() { BinderTest.prototype.testActionOnAHrefThrowsError = function(){ var model = {books:[]}; - var c = this.compile('Add Phone', model); + var c = this.compile('Add Phone', model); c.scope.action = function(){ throw {a:'abc', b:2}; }; @@ -450,23 +450,23 @@ BinderTest.prototype.testActionOnAHrefThrowsError = function(){ BinderTest.prototype.testShoulIgnoreVbNonBindable = function(){ var c = this.compile("
                          {{a}}" + - "
                          {{a}}
                          " + - "
                          {{b}}
                          " + - "
                          {{c}}
                          "); + "
                          {{a}}
                          " + + "
                          {{b}}
                          " + + "
                          {{c}}
                          "); c.scope.$set('a', 123); c.scope.$eval(); assertEquals('123{{a}}{{b}}{{c}}', c.node.text()); }; BinderTest.prototype.testOptionShouldUpdateParentToGetProperBinding = function() { - var c = this.compile(''); + var c = this.compile(''); c.scope.$set('s', 1); c.scope.$eval(); assertEquals(1, c.node[0].selectedIndex); }; BinderTest.prototype.testRepeaterShouldBindInputsDefaults = function () { - var c = this.compile('
                          '); + var c = this.compile('
                          '); c.scope.$set('items', [{}, {name:'misko'}]); c.scope.$eval(); @@ -475,7 +475,7 @@ BinderTest.prototype.testRepeaterShouldBindInputsDefaults = function () { }; BinderTest.prototype.testRepeaterShouldCreateArray = function () { - var c = this.compile(''); + var c = this.compile(''); c.scope.$eval(); assertEquals(0, c.scope.$get('items').length); @@ -486,7 +486,7 @@ BinderTest.prototype.testShouldTemplateBindPreElements = function () { c.scope.$set("name", "World"); c.scope.$eval(); - assertEquals('
                          Hello World!
                          ', sortedHtml(c.node)); + assertEquals('
                          Hello World!
                          ', sortedHtml(c.node)); }; BinderTest.prototype.testFillInOptionValueWhenMissing = function() { @@ -511,7 +511,7 @@ BinderTest.prototype.testFillInOptionValueWhenMissing = function() { BinderTest.prototype.testValidateForm = function() { var c = this.compile('
                          ' + - '
                          '); + '
                          '); var items = [{}, {}]; c.scope.$set("items", items); c.scope.$eval(); @@ -539,7 +539,7 @@ BinderTest.prototype.testValidateForm = function() { }; BinderTest.prototype.testValidateOnlyVisibleItems = function(){ - var c = this.compile('
                          '); + var c = this.compile('
                          '); jqLite(document.body).append(c.node); c.scope.$set("show", true); c.scope.$eval(); @@ -552,9 +552,9 @@ BinderTest.prototype.testValidateOnlyVisibleItems = function(){ BinderTest.prototype.testDeleteAttributeIfEvaluatesFalse = function() { var c = this.compile('
                          ' + - '' + - '' + - '
                          '); + '' + + '' + + '
                          '); c.scope.$eval(); function assertChild(index, disabled) { var child = childNode(c.node, index); @@ -571,8 +571,8 @@ BinderTest.prototype.testDeleteAttributeIfEvaluatesFalse = function() { BinderTest.prototype.testItShouldDisplayErrorWhenActionIsSyntacticlyIncorect = function(){ var c = this.compile('
                          ' + - '' + - '
                          '); + '' + + '
                          '); var first = jqLite(c.node[0].childNodes[0]); var second = jqLite(c.node[0].childNodes[1]); @@ -605,8 +605,8 @@ BinderTest.prototype.testItShouldSelectTheCorrectRadioBox = function() { BinderTest.prototype.testItShouldListenOnRightScope = function() { var c = this.compile( - '
                            ' + - '
                          '); + '
                            ' + + '
                          '); c.scope.$eval(); assertEquals(0, c.scope.$get("counter")); assertEquals(0, c.scope.$get("gCounter")); @@ -618,25 +618,25 @@ BinderTest.prototype.testItShouldListenOnRightScope = function() { }; BinderTest.prototype.testItShouldRepeatOnHashes = function() { - var x = this.compile('
                          '); + var x = this.compile('
                          '); x.scope.$eval(); assertEquals('
                            ' + '<#comment>' + - '
                          • a0
                          • ' + - '
                          • b1
                          • ' + + '
                          • a0
                          • ' + + '
                          • b1
                          • ' + '
                          ', sortedHtml(x.node)); }; BinderTest.prototype.testItShouldFireChangeListenersBeforeUpdate = function(){ - var x = this.compile('
                          '); + var x = this.compile('
                          '); x.scope.$set("name", ""); x.scope.$watch("watched", "name=123"); x.scope.$set("watched", "change"); x.scope.$eval(); assertEquals(123, x.scope.$get("name")); assertEquals( - '
                          123
                          ', + '
                          123
                          ', sortedHtml(x.node)); }; @@ -657,7 +657,7 @@ BinderTest.prototype.XtestItShouldRenderMultiRootHtmlInBinding = function() { x.scope.a = "acd"; x.scope.$eval(); assertEquals( - '
                          before acdafter
                          ', + '
                          before acdafter
                          ', sortedHtml(x.node)); }; diff --git a/test/ScenarioSpec.js b/test/ScenarioSpec.js index 9afe8e95..7ea3192d 100644 --- a/test/ScenarioSpec.js +++ b/test/ScenarioSpec.js @@ -1,6 +1,6 @@ describe("ScenarioSpec: Compilation", function(){ it("should compile dom node and return scope", function(){ - var node = jqLite('
                          {{b=a+1}}
                          ')[0]; + var node = jqLite('
                          {{b=a+1}}
                          ')[0]; var scope = compile(node); scope.$init(); expect(scope.a).toEqual(1); diff --git a/test/delete/WidgetsTest.js b/test/delete/WidgetsTest.js index 313d7372..9acc6126 100644 --- a/test/delete/WidgetsTest.js +++ b/test/delete/WidgetsTest.js @@ -111,7 +111,7 @@ RepeaterUpdaterTest.prototype.testShouldThrowInformativeSyntaxError= function(){ try { var repeater = new RepeaterUpdater(null, "a=b"); } catch (e) { - assertEquals("Expected ng-repeat in form of 'item in collection' but got 'a=b'.", e); + assertEquals("Expected ng:repeat in form of 'item in collection' but got 'a=b'.", e); } }; diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 42869a05..836c51e8 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -17,57 +17,57 @@ describe("directives", function(){ expect(size(jqCache)).toEqual(0); }); - it("should ng-init", function() { - var scope = compile('
                          '); + it("should ng:init", function() { + var scope = compile('
                          '); expect(scope.a).toEqual(123); }); - it("should ng-eval", function() { - var scope = compile('
                          '); + it("should ng:eval", function() { + var scope = compile('
                          '); expect(scope.a).toEqual(1); scope.$eval(); expect(scope.a).toEqual(2); }); - it('should ng-bind', function() { - var scope = compile('
                          '); + it('should ng:bind', function() { + var scope = compile('
                          '); expect(element.text()).toEqual(''); scope.a = 'misko'; scope.$eval(); expect(element.text()).toEqual('misko'); }); - it('should ng-bind html', function() { - var scope = compile('
                          '); + it('should ng:bind html', function() { + var scope = compile('
                          '); scope.html = '
                          hello
                          '; scope.$eval(); expect(lowercase(element.html())).toEqual('
                          hello
                          '); }); - it('should ng-bind element', function() { + it('should ng:bind element', function() { angularFilter.myElement = function() { return jqLite('hello'); }; - var scope = compile('
                          '); + var scope = compile('
                          '); scope.$eval(); expect(lowercase(element.html())).toEqual('hello'); }); - it('should ng-bind-template', function() { - var scope = compile('
                          '); + it('should ng:bind-template', function() { + var scope = compile('
                          '); scope.$set('name', 'Misko'); scope.$eval(); expect(element.text()).toEqual('Hello Misko!'); }); - it('should ng-bind-attr', function(){ - var scope = compile(''); + it('should ng:bind-attr', function(){ + var scope = compile(''); expect(element.attr('src')).toEqual('http://localhost/mysrc'); expect(element.attr('alt')).toEqual('myalt'); }); it('should remove special attributes on false', function(){ - var scope = compile(''); + var scope = compile(''); var input = scope.$element[0]; expect(input.disabled).toEqual(false); expect(input.readOnly).toEqual(false); @@ -83,15 +83,15 @@ describe("directives", function(){ expect(input.checked).toEqual(true); }); - it('should ng-non-bindable', function(){ - var scope = compile('
                          '); + it('should ng:non-bindable', function(){ + var scope = compile('
                          '); scope.$set('name', 'misko'); scope.$eval(); expect(element.text()).toEqual(''); }); - it('should ng-repeat over array', function(){ - var scope = compile('
                          '); + it('should ng:repeat over array', function(){ + var scope = compile('
                          '); scope.$set('items', ['misko', 'shyam']); scope.$eval(); @@ -106,28 +106,28 @@ describe("directives", function(){ expect(element.text()).toEqual('brad;'); }); - it('should ng-repeat over object', function(){ - var scope = compile('
                          '); + it('should ng:repeat over object', function(){ + var scope = compile('
                          '); scope.$set('items', {misko:'swe', shyam:'set'}); scope.$eval(); expect(element.text()).toEqual('misko:swe;shyam:set;'); }); - it('should set ng-repeat to [] if undefinde', function(){ - var scope = compile('
                          '); + it('should set ng:repeat to [] if undefinde', function(){ + var scope = compile('
                          '); expect(scope.items).toEqual([]); }); - it('should error on wrong parsing of ng-repeat', function(){ - var scope = compile('
                          '); + it('should error on wrong parsing of ng:repeat', function(){ + var scope = compile('
                          '); var log = ""; log += element.attr('ng-exception') + ';'; log += element.hasClass('ng-exception') + ';'; - expect(log).toEqual("\"Expected ng-repeat in form of 'item in collection' but got 'i dont parse'.\";true;"); + expect(log).toEqual("\"Expected ng:repeat in form of 'item in collection' but got 'i dont parse'.\";true;"); }); - it('should ng-watch', function(){ - var scope = compile('
                          '); + it('should ng:watch', function(){ + var scope = compile('
                          '); scope.$eval(); scope.$eval(); expect(scope.$get('count')).toEqual(0); @@ -138,8 +138,8 @@ describe("directives", function(){ expect(scope.$get('count')).toEqual(1); }); - it('should ng-click', function(){ - var scope = compile('
                          '); + it('should ng:click', function(){ + var scope = compile('
                          '); scope.$eval(); expect(scope.$get('clicked')).toBeFalsy(); @@ -147,16 +147,16 @@ describe("directives", function(){ expect(scope.$get('clicked')).toEqual(true); }); - it('should ng-class', function(){ - var scope = compile('
                          '); + it('should ng:class', function(){ + var scope = compile('
                          '); scope.$eval(); expect(element.hasClass('existing')).toBeTruthy(); expect(element.hasClass('A')).toBeTruthy(); expect(element.hasClass('B')).toBeTruthy(); }); - it('should ng-class odd/even', function(){ - var scope = compile('
                            • '); + it('should ng:class odd/even', function(){ + var scope = compile('
                                • '); scope.$eval(); var e1 = jqLite(element[0].childNodes[1]); var e2 = jqLite(element[0].childNodes[2]); @@ -166,14 +166,14 @@ describe("directives", function(){ expect(e2.hasClass('even')).toBeTruthy(); }); - it('should ng-style', function(){ - var scope = compile('
                                  '); + it('should ng:style', function(){ + var scope = compile('
                                  '); scope.$eval(); expect(element.css('color')).toEqual('red'); }); - it('should ng-show', function(){ - var scope = compile('
                                  '); + it('should ng:show', function(){ + var scope = compile('
                                  '); scope.$eval(); expect(isCssVisible(scope.$element)).toEqual(true); scope.$set('hide', true); @@ -181,8 +181,8 @@ describe("directives", function(){ expect(isCssVisible(scope.$element)).toEqual(false); }); - it('should ng-hide', function(){ - var scope = compile('
                                  '); + it('should ng:hide', function(){ + var scope = compile('
                                  '); scope.$eval(); expect(isCssVisible(scope.$element)).toEqual(false); scope.$set('show', true); @@ -190,7 +190,7 @@ describe("directives", function(){ expect(isCssVisible(scope.$element)).toEqual(true); }); - describe('ng-controller', function(){ + describe('ng:controller', function(){ it('should bind', function(){ window.Greeter = function(){ this.greeting = 'hello'; @@ -203,18 +203,18 @@ describe("directives", function(){ return this.greeting + ' ' + name + this.suffix; } }; - var scope = compile('
                                  '); + var scope = compile('
                                  '); expect(scope.greeting).toEqual('hello'); expect(scope.greet('misko')).toEqual('hello misko!'); window.Greeter = undefined; }); }); - it('should eval things according to ng-eval-order', function(){ + it('should eval things according to ng:eval-order', function(){ var scope = compile( - '
                                  ' + + '
                                  ' + '{{log = log + \'e\'}}' + - '' + + '' + '{{log = log + \'b\'}}' + '' + '' + diff --git a/test/markupSpec.js b/test/markupSpec.js index 8358b673..5fe5bba9 100644 --- a/test/markupSpec.js +++ b/test/markupSpec.js @@ -20,23 +20,23 @@ describe("markups", function(){ it('should translate {{}} in text', function(){ compile('
                                  hello {{name}}!
                                  '); - expect(sortedHtml(element)).toEqual('
                                  hello !
                                  '); + expect(sortedHtml(element)).toEqual('
                                  hello !
                                  '); scope.$set('name', 'Misko'); scope.$eval(); - expect(sortedHtml(element)).toEqual('
                                  hello Misko!
                                  '); + expect(sortedHtml(element)).toEqual('
                                  hello Misko!
                                  '); }); it('should translate {{}} in terminal nodes', function(){ compile(''); - expect(sortedHtml(element).replace(' selected="true"', '')).toEqual(''); + expect(sortedHtml(element).replace(' selected="true"', '')).toEqual(''); scope.$set('name', 'Misko'); scope.$eval(); - expect(sortedHtml(element).replace(' selected="true"', '')).toEqual(''); + expect(sortedHtml(element).replace(' selected="true"', '')).toEqual(''); }); it('should translate {{}} in attributes', function(){ compile(''); - expect(element.attr('ng-bind-attr')).toEqual('{"src":"http://server/{{path}}.png"}'); + expect(element.attr('ng:bind-attr')).toEqual('{"src":"http://server/{{path}}.png"}'); scope.$set('path', 'a/b'); scope.$eval(); expect(element.attr('src')).toEqual("http://server/a/b.png"); diff --git a/test/moveToAngularCom/miscTest.js b/test/moveToAngularCom/miscTest.js index aa0e1186..cc8f1c8c 100644 --- a/test/moveToAngularCom/miscTest.js +++ b/test/moveToAngularCom/miscTest.js @@ -1,7 +1,7 @@ BinderTest.prototype.testExpandEntityTagWithName = function(){ var c = this.compile('
                                  '); assertEquals( - '
                                  ', + '
                                  ', sortedHtml(c.node)); assertEquals("Person", c.scope.$get("friend.$entity")); assertEquals("friend", c.scope.$get("friend.$$anchor")); @@ -10,7 +10,7 @@ BinderTest.prototype.testExpandEntityTagWithName = function(){ BinderTest.prototype.testExpandSubmitButtonToAction = function(){ var html = this.compileToHtml(''); assertTrue(html, html.indexOf('ng-action="$save()"') > 0 ); - assertTrue(html, html.indexOf('ng-bind-attr="{"disabled":"{{$invalidWidgets}}"}"') > 0 ); + assertTrue(html, html.indexOf('ng:bind-attr="{"disabled":"{{$invalidWidgets}}"}"') > 0 ); }; BinderTest.prototype.testReplaceFileUploadWithSwf = function(){ @@ -29,7 +29,7 @@ BinderTest.prototype.testReplaceFileUploadWithSwf = function(){ BinderTest.prototype.testExpandEntityTagWithDefaults = function(){ assertEquals( - '
                                  ', + '
                                  ', this.compileToHtml('
                                  ')); }; diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index d621b1f1..3020dfba 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -65,7 +65,7 @@ function sortedHtml(element) { var attrs = []; for(var i=0; i'); + compile(''); expect(scope.$get('name')).toEqual("Misko"); expect(scope.$get('count')).toEqual(0); @@ -382,7 +382,7 @@ describe("widget", function(){ describe('ng:switch', function(){ it('should switch on value change', function(){ - compile('
                                  first:{{name}}
                                  second:{{name}}
                                  '); + compile('
                                  first:{{name}}
                                  second:{{name}}
                                  '); expect(element.html()).toEqual(''); scope.select = 1; scope.$eval(); @@ -399,7 +399,7 @@ describe("widget", function(){ }); it("should match urls", function(){ - var scope = angular.compile('
                                  {{params.name}}
                                  '); + var scope = angular.compile('
                                  {{params.name}}
                                  '); scope.url = '/Book/Moby'; scope.$init(); expect(scope.$element.text()).toEqual('Moby'); @@ -412,7 +412,7 @@ describe("widget", function(){ }); it('should call init on switch', function(){ - var scope = angular.compile('
                                  {{name}}
                                  '); + var scope = angular.compile('
                                  {{name}}
                                  '); var cleared = false; scope.url = 'a'; scope.$invalidWidgets = {clearOrphans: function(){ -- cgit v1.2.3