Currently, I am working with a directive that looks like this:
app.directive('updateinfo', function() {
function link(scope, element, attrs) {
function update(){
var str = '<input type="text" ng-model="scope.log1" />';
element.html(str);
}
update();
}
return {
link: link
};
});
The issue is that the text input box generated by the directive does not display the value of scope.log1
, and any changes made in the textbox are not reflected in the scope variable. My goal is to utilize the link function to access other scope variables
. Is there a way to make use of the link function and still bind data to the scope variable?
Any insights or assistance on this matter would be greatly appreciated.