Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular expression evaluate equal to

Tags:

angularjs

I'd like to make something like this.

<h3 ng-show="{{mode == 'create'}}">Create Vacancy</h3>
<h3 ng-show="{{mode == 'edit'}}">Edit this Vacancy</h3>

Where $scope.mode is either "create" or "edit".

How do I do this? Nothing I'm trying is working.

like image 466
markstewie Avatar asked Nov 28 '22 15:11

markstewie


1 Answers

ng-show evals expression itself, so don't use interpolated text. Update your code to:

<h3 ng-show="mode == 'create'">Create Vacancy</h3>
<h3 ng-show="mode == 'edit'">Edit this Vacancy</h3>
like image 153
Buu Nguyen Avatar answered Dec 14 '22 17:12

Buu Nguyen