我实际上是包含引导程序
<a data-href="#/speakers/{{speaker.id}}" ng-click="myFunc('{{speaker.id}}')">
<span class="speaker-name">{{speaker.name}}</span>
<span class="speaker-title-company">{{speaker.title}}, {{speaker.company}}</span>
</a>
ng-include
是
<ng-include id="speakers" data-ng-controller="SpeakerController" src="'js/view/partials/speakers.html'" ng-show="toggle"></ng-include>
boostrapping
var self = this;
angular.module(this.constructor.NAME, [])
.controller("SpeakerController", function($scope, $location){self.speakerController($scope, $location)})
angular.bootstrap(document.getElementById("speakers"), [this.constructor.NAME]);
然后是speakerController
speakerController: function($scope, $location) {
var self = this;
$scope.myFunc = function(param){console.log('in');self.myFunc(param)}
},
myFunc: function(param) {
console.log(param);
},
答案 0 :(得分:0)
更改为ng-click="myFunc(speaker.id)"
。你不需要在那里使用表达式。