I have a scope object named 'formData'.
In my page, the user chooses a dataSource and with http provider I store the result to formData.
$http.get($scope.options.dataSource.transport.read(id))
.success(function (data, status, headers, config) {
$scope.formData = data.value[0];
})
.error(function (data, status, header, config) {
});
Then in my html I want to use another component passing the formData I retrieve from the http request.
<input-text field="Code" caption="Code" dataitem="formData"></input-text>
In input-text component i have
var inputText = {
templateUrl: 'Input-text.tml.html',
bindings: {
field: '@',
caption: '@',
dataitem: '='
},
controller: function ($scope) {
$scope.field = this.field;
$scope.caption = this.caption;
$scope.dataitem = this.dataitem;
}
}
inputText.$inject = ['$scope'];
And in Input-text.tml.html
{{dataitem}}
But this doesn't work, seems it's not working as two way binding, this is: When formData changes, the component doesn't change the dataitem value.