1
我有這樣的元素在這裏:不能獲取的href內容NG單擊
<a href="#item1" ng-click="myfunc('arg1', 'arg2')">Item1</a>
<a href="#item2" ng-click="myfunc('arg1', 'arg2')">Item2</a>
「MYFUNC」 預計2個傳入參數。 現在,我還需要其他的東西,這是href-attribute的內容。
我可以做以下
1 - Add a new argument to the function
2 - Add the event argument to read the content of href-attribute
然而一個,在這個應用程序似乎有很多其他地方的功能「MYFUNC」之稱。 這意味着我需要修改它們以反映新的參數列表。
所以我想知道的是,如果在控制器中有一些知道調用元素的href包含的屬性。 這甚至可能嗎?