Exploring Angular and encountering an issue.
This is my HTML code:
<ul class="board-list gutter js-board-list clearfix">
<li class="" ng-repeat="board in boardsUserOwns.success.boards">
<a class="js-open-board highlight-icon unknown" ng-click="getBoardDetails('{{board[0]}}')" href="" style=" background-color: #0E74AF; ">
<span class="thumbnail" style=" ; background-color: #0E74AF; "></span>
<span class="fade"></span>
<span class="board-list-item-name" title="Geneva">{{board[0]}}</span>
</a>
</li>
<ul>
The specific line in question:
<a class="js-open-board highlight-icon unknown" ng-click="getBoardDetails('{{board[0]}}')" href="" style=" background-color: #0E74AF; ">
contains the Angular JS expression {{board[0]}}
.
After loading the page, the console displays this output:
<a class="js-open-board highlight-icon unknown" ng-click="getBoardDetails('userwithbelongsto1')" href="" style=" background-color: #0E74AF; ">
which functions correctly.
However, upon clicking the a
tag, the controller logs the unevaluated Angular code:
$scope.getBoardDetails = function(boardName)
{
console.log("The board name is " + boardName)
}
In the console, it shows:
The board name is {{board[0]}}
Feeling confused about where I might be going wrong.
Appreciate any guidance provided.