Hello what is right way to convert two way data binding in angularJS to one way?
I have component
import template from './test.component.html';
import controller from './test.controller';
export const DateWrapperComponent = {
bindings: {
test: '='
},
template,
controller
};
controller
export default function TestController($scope) {
/* ngInject */
$scope.$watch('$ctrl.test', () => {
console.log(this);
});
}
and view:
<input type="text" ng-model="$ctrl.test">
what is right way to convert it?
ng-bind="$ctrl.test"? ..... but if this is aninputwhy to use one way binding, maybe you want to set it toreadonly?