Angular2 - How To Use An Or Statement?
So I am working with active routes in order to manipulate a menu: My menu looks like this:
Solution 1:
You can use indexOf method of array like this:
['link1','link2','link3'].indexOf(currentPath) > -1
Solution 2:
The JavaScript operator for "or" is ||
currentPath == '/link1' || currentPath == '/link2' || currentPath == '/link3'
Post a Comment for "Angular2 - How To Use An Or Statement?"