【发布时间】:2018-07-17 22:52:19
【问题描述】:
例如:
form.js
angular.module('myForm', []);
form-input-component.js
angular.module('myForm').component('inputField', {
template: '<input type="text"></input>',
bindings: {
fieldName: '@',
value: '='
},
controller: function () { }
});
form-select-component.js
angular.module('myForm').component('inputSelect', {
template: '<select></select>',
bindings: {
fieldName: '@',
value: '='
},
controller: function () { }
});
是否可以在form.js 中定义所有常见的绑定?
【问题讨论】:
-
如果您尝试,您会收到任何错误吗?
-
是的,我在缺少
fieldName转换值时收到 $injector.modulerr 错误
标签: javascript angularjs components