I have a selector with more options, I want to hide a button if the first option of the selector is selected.
<select ng-model="$ctrl.type">
<option value="">none</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
as it can be seen, the first option has value =""
.
This is the button:
<div ng-show="$ctrl.type!=""" class="btn action-btn" ng-click="$ctrl.doSomething()">
my button
</div>
inside the controller I have this code:
class MyCtrl {
constructor(...) {
...
}
doSomething() {
this.type = "";
}
}
Why doesn't it work?