user6582640 user6582640 - 1 year ago 141
AngularJS Question

Getting $scope.variable in ng-if

I'm trying to simply use $scope.variable name like this

<a href="index.html" ng-if="{{variableName}}"> <!-- angular.js:11706 Error: [$parse:syntax] Syntax Error: Token '{' invalid key -->

How do I use {{variableName}} inside the ng-if statement?

Answer Source

replace with this

 <a href="index.html" ng-if="variableName">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download