0

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?

1
  • if Model.Technician is a bool, then @Model.Technician' == 'ng-disabled' will always be false. Commented Feb 13, 2018 at 20:53

1 Answer 1

0

Instead of writing a tonn of conditions into ng-disables it would be better to write a function into controller which return boolean result.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.