I am looking to develop a dynamic directive. This directive will have a template with an input element, and this element's ng-model attribute needs to be dynamic, utilizing $scope.name in the controller.
app.directive('helloWorld', function() {
return {
restrict: 'E',
replace: true,
scope: {
name: '@',
path:'@',
},
template: '<input\
type="text"\
name="{{name}}"\
ng-model="{{name}}"\
/>\,
link: function(scope, elem, attrs) {
},
controller:{
$scope.$watch($scope.name, function (newValue, oldValue) {
}
}
});