user6582640 user6582640 - 2 months ago 11
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?

SSH SSH
Answer

replace with this

 <a href="index.html" ng-if="variableName">