New to angularjs.
Want to write an expression into an ng-click.
example:
x.directive('li',function(){
return {
restrict: 'E',
replace: true,
template: '<games> <game ng-click="(alert({{ game }})" ng-repeat="game in games"> {{ game.team1 }} {{game.bets }} <game></br></games> '
}
});
I want to alert the game on click but I got this error:
Error: [$parse:syntax] Syntax Error: Token 'game' is unexpected, expecting [:] at column 11 of the expression [(alert({{ game }})] starting at [game }})].
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…