Der Winkelbereich "=" funktioniert nicht mit camelCase
Ich bin Geltungsbereich einer Richtlinie
Es funktioniert gut, wenn ich benutzeshow
als attr name.
<span ng-repeat="field in fields">
<field-pill field="field" show="true"></field-pill>
</span>
app.js
angular.module('app',[]);
angular.module('app')
.controller('AppCtrl', function($scope){
$scope.fields = [1,2,3,4];
});
angular.module('app')
.directive('fieldPill', function () {
return {
template: '<div class="pill">{{field}}:{{show}}--<span ng-show="show">x</span></div>',
restrict: 'E',
scope:{
field: "=",
"show": "="
}
};
});
(Siehe diesen Plunkrhttp://plnkr.co/edit/AcqmxeCerCOtGaw9dq9t?p=preview)
Aber die Direktive lädt die Booleschen Daten überhaupt nicht, wenn ich sie verwendex-show
als Attributname.
<span ng-repeat="field in fields">
<field-pill field="field" x-show="true"></field-pill>
</span>
app.js
angular.module('app',[]);
angular.module('app')
.controller('AppCtrl', function($scope){
$scope.fields = [1,2,3,4];
});
angular.module('app')
.directive('fieldPill', function () {
return {
template: '<div class="pill">{{field}}:{{xShow}}--<span ng-show="xShow">x</span></div>',
restrict: 'E',
scope:{
field: "=",
xShow: "="
}
};
});
Kann mir jemand erklären warum?
(Siehe diesen Plunkr für den Code mitx-show
http://plnkr.co/edit/2txoY3VaShH6WggnugcE?p=preview )