BinderTest = TestCase('BinderTest');
function compile(content, initialScope, config) {
var h = html(content);
config = config || {autoSubmit:true};
var scope = new nglr.Scope(initialScope, "ROOT");
h.data('scope', scope);
var binder = new nglr.Binder(h[0], new nglr.WidgetFactory(), new MockUrlWatcher(), config);
var datastore = new nglr.DataStore();
scope.set("$datastore", datastore);
scope.set("$binder", binder);
scope.set("$anchor", binder.anchor);
binder.entity(scope);
binder.compile();
return {node:h, binder:binder, scope:scope};
}
function compileToHtml(content) {
return compile(content).node.sortedHtml();
}
BinderTest.prototype.testParseTextWithNoBindings = function(){
var parts = nglr.Binder.parseBindings("a");
assertEquals(parts.length, 1);
assertEquals(parts[0], "a");
assertTrue(!nglr.Binder.binding(parts[0]));
};
BinderTest.prototype.testParseEmptyText = function(){
var parts = nglr.Binder.parseBindings("");
assertEquals(parts.length, 1);
assertEquals(parts[0], "");
assertTrue(!nglr.Binder.binding(parts[0]));
};
BinderTest.prototype.testParseInnerBinding = function(){
var parts = nglr.Binder.parseBindings("a{{b}}c");
assertEquals(parts.length, 3);
assertEquals(parts[0], "a");
assertTrue(!nglr.Binder.binding(parts[0]));
assertEquals(parts[1], "{{b}}");
assertEquals(nglr.Binder.binding(parts[1]), "b");
assertEquals(parts[2], "c");
assertTrue(!nglr.Binder.binding(parts[2]));
};
BinderTest.prototype.testParseEndingBinding = function(){
var parts = nglr.Binder.parseBindings("a{{b}}");
assertEquals(parts.length, 2);
assertEquals(parts[0], "a");
assertTrue(!nglr.Binder.binding(parts[0]));
assertEquals(parts[1], "{{b}}");
assertEquals(nglr.Binder.binding(parts[1]), "b");
};
BinderTest.prototype.testParseBeggingBinding = function(){
var parts = nglr.Binder.parseBindings("{{b}}c");
assertEquals(parts.length, 2);
assertEquals(parts[0], "{{b}}");
assertEquals(nglr.Binder.binding(parts[0]), "b");
assertEquals(parts[1], "c");
assertTrue(!nglr.Binder.binding(parts[1]));
};
BinderTest.prototype.testParseLoanBinding = function(){
var parts = nglr.Binder.parseBindings("{{b}}");
assertEquals(parts.length, 1);
assertEquals(parts[0], "{{b}}");
assertEquals(nglr.Binder.binding(parts[0]), "b");
};
BinderTest.prototype.testParseTwoBindings = function(){
var parts = nglr.Binder.parseBindings("{{b}}{{c}}");
assertEquals(parts.length, 2);
assertEquals(parts[0], "{{b}}");
assertEquals(nglr.Binder.binding(parts[0]), "b");
assertEquals(parts[1], "{{c}}");
assertEquals(nglr.Binder.binding(parts[1]), "c");
};
BinderTest.prototype.testParseTwoBindingsWithTextInMiddle = function(){
var parts = nglr.Binder.parseBindings("{{b}}x{{c}}");
assertEquals(parts.length, 3);
assertEquals(parts[0], "{{b}}");
assertEquals(nglr.Binder.binding(parts[0]), "b");
assertEquals(parts[1], "x");
assertTrue(!nglr.Binder.binding(parts[1]));
assertEquals(parts[2], "{{c}}");
assertEquals(nglr.Binder.binding(parts[2]), "c");
};
BinderTest.prototype.testParseMultiline = function(){
var parts = nglr.Binder.parseBindings('"X\nY{{A\nB}}C\nD"');
assertTrue(!!nglr.Binder.binding('{{A\nB}}'));
assertEquals(parts.length, 3);
assertEquals(parts[0], '"X\nY');
assertEquals(parts[1], '{{A\nB}}');
assertEquals(parts[2], 'C\nD"');
};
BinderTest.prototype.testHasBinding = function(){
assertTrue(nglr.Binder.hasBinding("{{a}}"));
assertTrue(!nglr.Binder.hasBinding("a"));
assertTrue(nglr.Binder.hasBinding("{{b}}x{{c}}"));
};
BinderTest.prototype.tearDown = function(){
jQuery("*", document).die();
jQuery(document).unbind();
};
BinderTest.prototype.testChangingTextfieldUpdatesModel = function(){
var state = compile('', {model:{}});
state.binder.updateView();
assertEquals('abc', state.scope.get('model').price);
};
BinderTest.prototype.testChangingTextareaUpdatesModel = function(){
var form = html('');
var scope = new nglr.Scope({model:{}});
form.data('scope', scope);
var binder = new nglr.Binder(form.get(0), new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
binder.updateView();
assertEquals(scope.get('model').note, 'abc');
};
BinderTest.prototype.testChangingRadioUpdatesModel = function(){
var form = html('' +
'');
var scope = new nglr.Scope({model:{}});
form.data('scope', scope);
var binder = new nglr.Binder(form.get(0), new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
binder.updateView();
assertEquals(scope.get('model').price, 'A');
};
BinderTest.prototype.testChangingCheckboxUpdatesModel = function(){
var form = html('');
var scope = new nglr.Scope({model:{}});
form.data('scope', scope);
var binder = new nglr.Binder(form.get(0), new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
binder.updateView();
assertEquals('A', scope.get('model').price);
};
BinderTest.prototype.testBindUpdate = function() {
var c = compile('
');
c.binder.updateView();
assertEquals(123, c.scope.get('a'));
};
BinderTest.prototype.testChangingSelectNonSelectedUpdatesModel = function(){
var form = html('');
var scope = new nglr.Scope({model:{}});
form.data('scope', scope);
var binder = new nglr.Binder(form.get(0), new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
binder.updateView();
assertEquals('A', scope.get('model').price);
};
BinderTest.prototype.testChangingMultiselectUpdatesModel = function(){
var form = html('');
var scope = new nglr.Scope({Invoice:{}});
form.data('scope', scope);
var binder = new nglr.Binder(form.get(0), new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
binder.updateView();
assertJsonEquals(["A", "B"], scope.get('Invoice').options);
};
BinderTest.prototype.testChangingSelectSelectedUpdatesModel = function(){
var form = html('');
var scope = new nglr.Scope({model:{}});
form.data('scope', scope);
var binder = new nglr.Binder(form.get(0), new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
binder.updateView();
assertEquals(scope.get('model').price, 'b');
};
BinderTest.prototype.testExecuteInitialization = function() {
var form = html('
');
var scope = new nglr.Scope();
form.data('scope', scope);
var binder = new nglr.Binder(form.get(0));
binder.executeInit();
assertEquals(scope.get('a'), 123);
};
BinderTest.prototype.testExecuteInitializationStatements = function() {
var form = html('
');
var scope = new nglr.Scope();
form.data('scope', scope);
var binder = new nglr.Binder(form.get(0));
binder.executeInit();
assertEquals(scope.get('a'), 123);
assertEquals(scope.get('b'), 345);
};
BinderTest.prototype.testApplyTextBindings = function(){
var form = html('
x
');
var scope = new nglr.Scope({model:{a:123}});
form.data('scope', scope);
var binder = new nglr.Binder(form.get(0), null, new MockUrlWatcher());
binder.compile();
binder.updateView();
assertEquals('123', form.text());
};
BinderTest.prototype.testReplaceBindingInTextWithSpan = function() {
assertEquals(compileToHtml("a{{b}}c"), 'ac');
assertEquals(compileToHtml("{{b}}"), '');
};
BinderTest.prototype.testReplaceBindingCreatesCorrectNumberOfWidgets = function() {
var h = html("space{{a}}{{a}}a{{a}}{{a}}");
h.data('scope', new nglr.Scope());
var binder = new nglr.Binder(h.get(0), new nglr.WidgetFactory());
binder.compile();
assertEquals(4, h.scope().widgets.length);
};
BinderTest.prototype.testBindingSpaceConfusesIE = function() {
if (!nglr.msie) return;
var span = document.createElement("span");
span.innerHTML = ' ';
var nbsp = span.firstChild.nodeValue;
assertEquals(
''+nbsp+'',
compileToHtml("{{a}} {{b}}"));
assertEquals(
''+nbsp+'x '+nbsp+'(',
compileToHtml("{{A}} x {{B}} ({{C}})"));
};
BinderTest.prototype.testBindingOfAttributes = function() {
var form = html("");
form.data('scope', new nglr.Scope());
var binder = new nglr.Binder(form.get(0));
binder.compile();
var attrbinding = form.find("a").attr("ng-bind-attr");
var bindings = nglr.fromJson(attrbinding);
assertEquals("http://s/a{{b}}c", decodeURI(bindings.href));
assertTrue(!bindings.foo);
};
BinderTest.prototype.testMarkMultipleAttributes = function() {
var form = html("");
form.data('scope', new nglr.Scope());
var binder = new nglr.Binder(form.get(0));
binder.compile();
var attrbinding = form.find("a").attr("ng-bind-attr");
var bindings = nglr.fromJson(attrbinding);
assertEquals(decodeURI(bindings.href), "http://s/a{{b}}c");
assertEquals(bindings.foo, "{{d}}");
};
BinderTest.prototype.testAttributesNoneBound = function() {
var form = html("");
form.data('scope', new nglr.Scope());
var binder = new nglr.Binder(form.get(0));
binder.compile();
var a = form.find("a");
assertEquals(a.get(0).nodeName, "A");
assertTrue(!a.attr("ng-bind-attr"));
};
BinderTest.prototype.testExistingAttrbindingIsAppended = function() {
var form = html("");
form.data('scope', new nglr.Scope());
var binder = new nglr.Binder(form.get(0));
binder.compile();
var a = form.find("a");
assertEquals('{"b":"{{def}}","href":"http://s/{{abc}}"}', a.attr('ng-bind-attr'));
};
BinderTest.prototype.testAttributesAreEvaluated = function(){
var form = html('');
form.data('scope', new nglr.Scope({a:1, b:2}));
var binder = new nglr.Binder(form.get(0), null, new MockUrlWatcher());
binder.compile();
binder.updateView();
var a = form.find("a");
assertEquals(a.attr('a'), 'a');
assertEquals(a.attr('b'), 'a+b=3');
};
BinderTest.prototype.testInputsAreUpdated = function(){
var form =
html('' +
'' +
'' +
'' +
'' +
'' +
'');
var binder = new nglr.Binder(form.get(0), new nglr.WidgetFactory(), new MockUrlWatcher());
form.data('scope', new nglr.Scope({A:{text:"t1", textarea:"t2", radio:"r", checkbox:"c", select:"S"}}));
binder.compile();
binder.updateView();
assertEquals(form.find("input[type=text]").attr('value'), 't1');
assertEquals(form.find("textarea").attr('value'), 't2');
assertTrue(form.find("input[name=A.radio]").attr('checked'));
assertTrue(!form.find("input[name=A.radioOff]").attr('checked'));
assertTrue(form.find("input[name=A.checkbox]").attr('checked'));
assertTrue(!form.find("input[name=A.checkboxOff]").attr('checked'));
assertEquals(form.find("select").attr('value'), 'S');
assertEquals(form.find("option[selected]").text(), 'b');
};
BinderTest.prototype.testInputTypeButtonActionExecutesInScope = function(){
var savedCalled = false;
var c = compile('');
c.scope.set("person.save", function(){
savedCalled = true;
});
c.node.find("#apply").click();
assertTrue(savedCalled);
};
BinderTest.prototype.testInputTypeButtonActionExecutesInScope = function(){
expectAsserts(1);
var c = compile('');
c.scope.set("action", function(){
assertTrue(true);
});
c.node.find("#apply").click();
};
BinderTest.prototype.testButtonElementActionExecutesInScope = function(){
var savedCalled = false;
var c = compile('');
c.scope.set("person.save", function(){
savedCalled = true;
});
c.node.find("#apply").click();
assertTrue(savedCalled);
};
BinderTest.prototype.testParseEmptyAnchor = function(){
var binder = new nglr.Binder(null, null, new MockUrlWatcher());
var anchor = binder.anchor;
binder.parseAnchor("a#x=1");
assertEquals(1, binder.anchor.x);
binder.parseAnchor("a#");
assertTrue("old values did not get removed", !binder.anchor.x);
assertTrue("anchor gor replaced", anchor === binder.anchor);
assertEquals('undefined', typeof (anchor[""]));
};
BinderTest.prototype.testParseAnchor = function(){
var binder = new nglr.Binder(null, null, new MockUrlWatcher());
binder.parseAnchor("a#x=1");
assertEquals(binder.anchor.x, "1");
binder.parseAnchor("a#a=b&c=%20&d");
assertEquals(binder.anchor.a, 'b');
assertEquals(binder.anchor.c, ' ');
assertTrue(binder.anchor.d !== null);
assertTrue(!binder.anchor.x);
};
BinderTest.prototype.testWriteAnchor = function(){
var binder = new nglr.Binder(null, null, new MockUrlWatcher());
binder.urlWatcher.setUrl('a');
binder.anchor.a = 'b';
binder.anchor.c = ' ';
binder.anchor.d = true;
binder.updateAnchor();
assertEquals(binder.urlWatcher.getUrl(), "a#a=b&c=%20&d");
};
BinderTest.prototype.testWriteAnchorAsPartOfTheUpdateView = function(){
var binder = new nglr.Binder(html("")[0], null, new MockUrlWatcher());
binder.urlWatcher.setUrl('a');
$(binder.doc).data('scope', new nglr.Scope());
binder.anchor.a = 'b';
binder.updateView();
assertEquals(binder.urlWatcher.getUrl(), "a#a=b");
};
BinderTest.prototype.testRepeaterUpdateBindings = function(){
var form = html('
');
var binder = new nglr.Binder(form.get(0), null, new MockUrlWatcher());
var items = [{a:"A"}, {a:"B"}];
form.data('scope', new nglr.Scope({model:{items:items}}));
binder.compile();
binder.updateView();
assertEquals('
', form.sortedHtml());
};
BinderTest.prototype.testRepeaterContentDoesNotBind = function(){
var form = html('
');
form.data('scope', new nglr.Scope({model:{items:[{a:"A"}]}}));
var binder = new nglr.Binder(form.get(0), null, new MockUrlWatcher());
binder.compile();
binder.updateView();
assertEquals('
' +
'<#comment>#comment>' +
'
A
' +
'
', form.sortedHtml());
};
BinderTest.prototype.testShouldBindActionsOnRepeaterClone = function(){
var c = compile('link');
jQuery(c).die();
c.scope.set('result.value', false);
c.scope.set('items', ['abc', 'xyz']);
c.scope.updateView();
assertEquals(2, c.node.find("a").size());
c.node.find("a:last").click();
assertEquals('xyz', c.scope.get('result.value'));
};
BinderTest.prototype.testRepeaterInputContentDoesNotBind = function(){
var form =
html('
' +
'
');
var binder = new nglr.Binder(form.get(0), null, new MockUrlWatcher());
var items = [{a:"A"}];
form.data('scope', new nglr.Scope({model:{items:items}}));
assertEquals(form.find(":input").attr("value"), "OLD");
};
BinderTest.prototype.testExpandEntityTag = function(){
assertEquals(
'',
compileToHtml(''));
};
BinderTest.prototype.testExpandEntityTagWithDefaults = function(){
assertEquals(
'',
compileToHtml('
'));
};
BinderTest.prototype.testExpandEntityTagWithName = function(){
var c = compile('');
assertEquals(
'',
c.node.sortedHtml());
assertEquals("Person", c.scope.get("friend.$entity"));
assertEquals("friend", c.scope.get("friend.$$anchor"));
};
BinderTest.prototype.testExpandSubmitButtonToAction = function(){
var html = compileToHtml('');
assertTrue(html, html.indexOf('ng-action="$save()"') > 0 );
assertTrue(html, html.indexOf('ng-bind-attr="{"disabled":"{{$invalidWidgets}}"}"') > 0 );
};
BinderTest.prototype.testDoNotOverwriteCustomAction = function(){
var html = compileToHtml('');
assertTrue(html.indexOf('action="foo();"') > 0 );
};
BinderTest.prototype.testReplaceFileUploadWithSwf = function(){
expectAsserts(1);
var form = jQuery("body").append('');
form.data('scope', new nglr.Scope());
var factory = {};
var binder = new nglr.Binder(form.get(0), factory, new MockUrlWatcher());
factory.createController = function(node){
assertEquals(node.attr('type'), 'file');
return {updateModel:function(){}};
};
binder.compile();
jQuery("#testTag").remove();
};
BinderTest.prototype.testRepeaterAdd = function(){
var doc = $('');
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
doc.data('scope', new nglr.Scope({items:[{x:'a'}, {x:'b'}], $binder:binder}));
binder.compile();
binder.updateView();
assertEquals('a', doc.find(':input')[0].value);
assertEquals('b', doc.find(':input')[1].value);
var first = doc.find('[ng-repeat-index="0"]');
first[0].value = 'ABC';
first.trigger('keyup');
assertEquals(doc.scope().get('items')[0].x, 'ABC');
};
BinderTest.prototype.testIfTextBindingThrowsErrorDecorateTheSpan = function(){
var doc = $('
{{error.throw()}}
');
var scope = new nglr.Scope();
doc.data('scope', scope);
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
scope.set('error.throw', function(){throw "ErrorMsg1";});
binder.updateView();
var span = doc.find('span');
assertTrue(span.hasClass('ng-exception'));
assertEquals('ErrorMsg1', nglr.fromJson(span.text()));
assertEquals('"ErrorMsg1"', span.attr('ng-error'));
scope.set('error.throw', function(){throw "MyError";});
binder.updateView();
span = doc.find('span');
assertTrue(span.hasClass('ng-exception'));
assertTrue(span.text(), span.text().match('MyError') !== null);
assertEquals('"MyError"', span.attr('ng-error'));
scope.set('error.throw', function(){return "ok";});
binder.updateView();
assertFalse(span.hasClass('ng-exception'));
assertEquals('ok', span.text());
assertEquals(null, span.attr('ng-error'));
};
BinderTest.prototype.testIfAttrBindingThrowsErrorDecorateTheSpan = function(){
var doc = $('');
var scope = new nglr.Scope();
doc.data('scope', scope);
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
scope.set('error.throw', function(){throw "ErrorMsg";});
binder.updateView();
assertTrue('ng-exception', doc.hasClass('ng-exception'));
assertEquals('before ["ErrorMsg"] after', doc.attr('attr'));
assertEquals('"ErrorMsg"', doc.attr('ng-error'));
scope.set('error.throw', function(){ return 'X';});
binder.updateView();
assertFalse('!ng-exception', doc.hasClass('ng-exception'));
assertEquals('before X after', doc.attr('attr'));
assertEquals(null, doc.attr('ng-error'));
};
BinderTest.prototype.testNestedRepeater = function() {
var doc = html('
' +
'
' +
'
');
var scope = new nglr.Scope();
doc.data('scope', scope);
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
scope.set('model', [{name:'a', item:['a1', 'a2']}, {name:'b', item:['b1', 'b2']}]);
binder.updateView();
assertEquals(
//'<#comment>#comment>'+
'
'+
'<#comment>#comment>'+
'
'+
'
'+
'
'+
'
'+
'<#comment>#comment>'+
'
'+
'
'+
'
', doc.sortedHtml());
};
BinderTest.prototype.testRadioButtonGetsPrefixed = function () {
var doc = html('');
var scope = new nglr.Scope();
doc.data('scope', scope);
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
scope.set('model', ['a1', 'a2']);
binder.updateView();
assertEquals(
//'<#comment>#comment>'+
''+
'',
doc.sortedHtml());
};
BinderTest.prototype.testHideBindingExpression = function() {
var doc = html('');
var scope = new nglr.Scope();
doc.data('scope', scope);
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
scope.set('hidden', 3);
binder.updateView();
assertHidden(doc.children());
scope.set('hidden', 2);
binder.updateView();
assertVisible(doc.children());
};
BinderTest.prototype.testHideBinding = function() {
var doc = html('');
var scope = new nglr.Scope();
doc.data('scope', scope);
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
scope.set('hidden', 'true');
binder.updateView();
assertHidden(doc.children());
scope.set('hidden', 'false');
binder.updateView();
assertVisible(doc.children());
scope.set('hidden', '');
binder.updateView();
assertVisible(doc.children());
};
BinderTest.prototype.testShowBinding = function() {
var doc = html('');
var scope = new nglr.Scope();
doc.data('scope', scope);
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
scope.set('show', 'true');
binder.updateView();
assertVisible(doc.children());
scope.set('show', 'false');
binder.updateView();
assertHidden(doc.children());
scope.set('show', '');
binder.updateView();
assertHidden(doc.children());
};
BinderTest.prototype.testBindClassUndefined = function() {
var doc = compile('');
doc.binder.updateView();
assertEquals(
'',
doc.node.sortedHtml());
};
BinderTest.prototype.testBindClass = function() {
var doc = html('');
var scope = new nglr.Scope();
doc.data('scope', scope);
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
scope.set('class', 'testClass');
binder.updateView();
assertEquals(doc.sortedHtml(),
'');
scope.set('class', ['a', 'b']);
binder.updateView();
assertEquals(doc.sortedHtml(),
'');
};
BinderTest.prototype.testBindClassEvenOdd = function() {
var x = compile('');
x.binder.updateView();
assertEquals(
'' +
'',
x.node.sortedHtml());
};
BinderTest.prototype.testBindStyle = function() {
var doc = html('');
var scope = new nglr.Scope();
doc.data('scope', scope);
var binder = new nglr.Binder(doc[0], new nglr.WidgetFactory(), new MockUrlWatcher());
binder.compile();
scope.eval('style={color:"red"}');
binder.updateView();
assertEquals("red", doc.find('div').css('color'));
scope.eval('style={}');
binder.updateView();
assertEquals(doc.sortedHtml(), '');
};
BinderTest.prototype.testActionOnAHrefThrowsError = function(){
var model = {books:[]};
var state = compile('Add Phone', model);
var input = state.node.find('a');
input.click();
assertEquals('abc', nglr.fromJson(input.attr('ng-error')).a);
assertNotNull(input.data('qtip'));
assertTrue("should have an error class", input.hasClass('ng-exception'));
input.attr('ng-action', '0');
input.click();
assertFalse('error class should be cleared', input.hasClass('ng-exception'));
};
BinderTest.prototype.testShoulIgnoreVbNonBindable = function(){
var c = compile("{{a}}" +
"
{{a}}
" +
"
{{b}}
" +
"
{{c}}
");
c.scope.set('a', 123);
c.scope.updateView();
assertEquals('123{{a}}{{b}}{{c}}', c.node.text());
};
BinderTest.prototype.testOptionShouldUpdateParentToGetProperBinding = function() {
var c = compile('');
c.scope.set('s', 1);
c.binder.updateView();
assertEquals(1, c.node.find('select')[0].selectedIndex);
};
BinderTest.prototype.testRepeaterShouldBindInputsDefaults = function () {
var c = compile('');
c.scope.set('items', [{}, {name:'misko'}]);
c.binder.updateView();
assertEquals("123", c.scope.eval('items[0].name'));
assertEquals("misko", c.scope.eval('items[1].name'));
};
BinderTest.prototype.testRepeaterShouldCreateArray = function () {
var c = compile('');
c.binder.updateView();
assertEquals(0, c.scope.get('items').length);
};
BinderTest.prototype.testShouldTemplateBindPreElements = function () {
var c = compile('