For some reason, I have to use dash in property like test-name
and cannot use testName
or testname
:
angular.module(\'testA
Try this, it should work:
<div ng-controller="TestController">
This is {{this['test-name']}}
</div>
That is because when {{test-name}}
is parsed by $parseProvider
and Lexer
in angular, the -
is recoginzed as an minus operator.
https://github.com/angular/angular.js/blob/master/src/ng/parse.js#L1005
{{this['test-name']}}
should work