parent
28aa7466bd
commit
59a1f836a2
|
@ -134,7 +134,7 @@ export class CompileElement {
|
||||||
// by the "value", or exported identifier. For example, ng-repeat sets a view local of "index".
|
// by the "value", or exported identifier. For example, ng-repeat sets a view local of "index".
|
||||||
// When this occurs, a lookup keyed by "index" must occur to find if there is a var referencing
|
// When this occurs, a lookup keyed by "index" must occur to find if there is a var referencing
|
||||||
// it.
|
// it.
|
||||||
MapWrapper.set(this.variableBindings, variableValue, variableName);
|
MapWrapper.set(this.variableBindings, variableValue, dashCaseToCamelCase(variableName));
|
||||||
}
|
}
|
||||||
|
|
||||||
addEventBinding(eventName:string, expression:AST) {
|
addEventBinding(eventName:string, expression:AST) {
|
||||||
|
|
|
@ -419,6 +419,23 @@ export function main() {
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
it('should assign the element instance to a user-defined variable with camelCase using dash-case', inject([AsyncTestCompleter], (async) => {
|
||||||
|
tplResolver.setTemplate(MyComp,
|
||||||
|
new Template({inline: '<p><div var-super-alice><i>Hello</i></div></p>'}));
|
||||||
|
|
||||||
|
compiler.compile(MyComp).then((pv) => {
|
||||||
|
createView(pv);
|
||||||
|
expect(view.locals).not.toBe(null);
|
||||||
|
|
||||||
|
var value = view.locals.get('superAlice');
|
||||||
|
expect(value).not.toBe(null);
|
||||||
|
expect(value.tagName.toLowerCase()).toEqual('div');
|
||||||
|
|
||||||
|
async.done();
|
||||||
|
})
|
||||||
|
}));
|
||||||
|
|
||||||
it('should provide binding configuration config to the component', inject([AsyncTestCompleter], (async) => {
|
it('should provide binding configuration config to the component', inject([AsyncTestCompleter], (async) => {
|
||||||
tplResolver.setTemplate(MyComp, new Template({
|
tplResolver.setTemplate(MyComp, new Template({
|
||||||
inline: '<push-cmp #cmp></push-cmp>',
|
inline: '<push-cmp #cmp></push-cmp>',
|
||||||
|
|
Loading…
Reference in New Issue