I'm trying to create a simple directive for a test app I'm making. My directive is as follows:
.directive('answer', function(){
return {
restrict: "E",
scope: {
minl: "=",
model: "="
},
template: '<input id="option" name="opts" type="text" ng-model="model" ng-minlength="minl">'
}
})
In my html file I'm using this directive with the following code:
<answer ng-repeat="option in newQuestion.opts" minl="minLength" model="option.value"></answer>
I have a minLength property on my controller scope (equal to 10) and option.value has a value on the scope as well. However, my template does not pull in either of these values when I load the html page. Does anybody have any advice on what I might be doing wrong here?