This is the directive i have created using Angular 6
myProSupMod.directive('dfct', ['$compile', function ($compile) {
return {
restrict: 'E',
scope: {
ngModel: '='
},
template: "<div class='divRow'><div class='divCell label-column'>
</div><div class='divCell'><input ng-model='ngModel' /></div></div>",
replace: true,
require: 'ngModel',
link: function ($scope, elem, attr, ctrl) {
$compile(elem)($scope.$parent);
}
}
}])
And i'm calling the directive from html like
<dfct ng-model="RootObjectName"></dfct>
Html is rendered as expected but the RootObjectName model in the scope is never updated when value of the text field is changed.
please help Thanks