I have a question regarding the rendering of a custom directive and its output in the DOM. This is related to a previous inquiry I had.
Below is the implementation of my directive:
angular.module('moduleName')
.directive('selectValue', ['$timeout', function($timeout) {
const directive = {
restrict: 'E',
replace: true,
scope: {
controlId: '@',
model: '=?'
},
controller: 'selectValueCtrl',
templateUrl: 'template.html'
};
return directive;
}
The external template used:
<!-- template.html -->
<input id="{{controlId}}" name="{{controlId}}" placeholder="Enter Value"
type="text" ng-model="model" />
When using the directive as follows:
<select-value controlId="selectValue" model="data.value"></selectValue>
It renders like this:
<input id="selectValue" ng-model="model" />
Instead of:
<input id="selectValue" ng-model="data.value" />
I'm uncertain if I made an error in my code, or if this is the intended behavior. Your insights would be appreciated!