I am trying to use the ng-model attribute on a dropdown, however WebStorm keeps telling that it is not allowed. When I run the app, it is not bound so I thinking it has do with my Angular version. I am running the latest version, and ng-model seems to work on all other elements besides select. Has something changed within the last update?
<div class="form-group">
<label for="selectPost" class="control-label">Posts</label>
<select ng-model="post" class="form-control" id="selectPost" >
<option ng-repeat="post in currentUser.posts" value="{{post._id}}">
{{post.name}}
</option>
</select>
</div>
change ng-model
into data-ng-model
,
it is a known WebStorm bug
This may not be the solution to your problem, but I was getting "not allowed here" for a lot Angular attributes inexplicably.
It turned out that I had excluded the folder that included the angular.js from my project so that it didn't bother me with my normal day to day. It meant that the page worked fine when created but Webstorm wasn't able to read it as I was writing the code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With