Home angularjs ng-disabled with MVC Model and angular scoped model
Reply: 0

angularjs ng-disabled with MVC Model and angular scoped model

user651
1#
user651 Published in June 19, 2018, 4:16 pm

I want to use a combination of my angular model and MVC model to disable an anchor tag (Model.Technician is a bool):

<a href="#" title="" class="btn btn-default" ng-disabled="selectedTasksCount <= 0 || '@Model.Technician' == 'true'" >Click here</a>

I ended up having to do this:

<a href="#" title="" class="btn btn-default" ng-disabled="selectedTasksCount <= 0 || '@Model.Technician' == 'ng-disabled'" >Click here</a>

... because Model.Technicain always seems to render as 'ng-disabled'. What am I doing wrong or is there a better way?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.344657 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO