我不能將布爾值傳遞給我的指令。AngularJS:將布爾值傳遞給指令
這裏是我的HMTL:
<city-zip city="clientCity" zip="clientZip" requiredParam="'true'"></city-zip>
和指導:
.directive('cityZip', function() {
return {
restrict: 'E',
templateUrl: '../templates/templateCityZip.html',
scope: {
city: '=',
zip: '='
},
controller: function($scope) {}
}
});
任何幫助將非常感激。
只要創建一個範圍變量來檢查這一點。 Theres不需要像串一樣傳遞。你應該通過作爲變量 – Fals