4
rated 0 times
[
5]
[
1]
/ answers: 1 / hits: 17243
/ 9 Years ago, wed, april 15, 2015, 12:00:00
I'm using the fabulous UI Bootstrap for Angular but am having difficulty getting an onclick event raised.
Here is the code:
<ul class=dropdown-menu role=menu>
<li><a><img src='/Content/Images/dept_cargo.png'/> CARGO</a></li>
<li><a><img src='/Content/Images/dept_commercial.png'/> COMMJ</a></li>
<li><a><img src='/Content/Images/dept_executive.png'/> EXECJ</a></li>
<li><a><img src='/Content/Images/dept_travel.png'/> TVL</a></li>
</ul>
{{ currentDepartment }}
I've tried every combination: putting the ng-click=behaviour() variously inside the li, the a and the img, but nothing seems to work.
What am I doing wrong?
(ideally I'd just like to change the value of a scope variable but I'm thinking calling a behaviour to do the work is better practice)
This question is not the same as suggested above. The other question is to do with scope, whereas I would be happy just to be able to execute an alert(); from one of my li's.
More From » angularjs