本文整理汇总了TypeScript中angular2/src/core/compiler/view.ProtoView.bindDirectiveProperty方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ProtoView.bindDirectiveProperty方法的具体用法?TypeScript ProtoView.bindDirectiveProperty怎么用?TypeScript ProtoView.bindDirectiveProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/core/compiler/view.ProtoView
的用法示例。
在下文中一共展示了ProtoView.bindDirectiveProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should notify a directive about changes after all its properties have been set', () => {
var pv = new ProtoView(el('<div class="ng-binding"></div>'), new DynamicProtoChangeDetector(null, null), null);
pv.bindElement(null, 0, new ProtoElementInjector(null, 0, [DirectiveBinding.createFromType(DirectiveImplementingOnChange, new DummyDirective({lifecycle: [onChange]}))]));
pv.bindDirectiveProperty(0, parser.parseBinding('a', null), 'a', reflector.setter('a'));
pv.bindDirectiveProperty(0, parser.parseBinding('b', null), 'b', reflector.setter('b'));
createViewAndChangeDetector(pv);
ctx.a = 100;
ctx.b = 200;
cd.detectChanges();
var directive = view.elementInjectors[0].get(DirectiveImplementingOnChange);
expect(directive.c).toEqual(300);
});