@ -133,6 +133,23 @@ export function main() {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should consume binding to camel-cased properties using dash-cased syntax in templates', inject([AsyncTestCompleter], (async) => {
|
||||
tplResolver.setTemplate(MyComp, new Template({inline: '<input [read-only]="ctxBoolProp">'}));
|
||||
|
||||
compiler.compile(MyComp).then((pv) => {
|
||||
createView(pv);
|
||||
|
||||
cd.detectChanges();
|
||||
expect(view.nodes[0].readOnly).toBeFalsy();
|
||||
|
||||
ctx.ctxBoolProp = true;
|
||||
cd.detectChanges();
|
||||
expect(view.nodes[0].readOnly).toBeTruthy();
|
||||
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
|
||||
it('should consume binding to inner-html', inject([AsyncTestCompleter], (async) => {
|
||||
tplResolver.setTemplate(MyComp, new Template({inline: '<div inner-html="{{ctxProp}}"></div>'}));
|
||||
|
||||
@ -592,9 +609,11 @@ class PushBasedComp {
|
||||
class MyComp {
|
||||
ctxProp:string;
|
||||
ctxNumProp;
|
||||
ctxBoolProp;
|
||||
constructor() {
|
||||
this.ctxProp = 'initial value';
|
||||
this.ctxNumProp = 0;
|
||||
this.ctxBoolProp = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user