When using a template, controllerAsyou must use an alias controllerwhen accessing any variable from a controller function. But this should be limited by thiscontext controller.
<button ng-click="todoList.example(todo)">Click me</button>
Demo here
Extended
this factory. this , , this, , this, this , .
angular.module('todoApp', [])
.controller('TodoListController', function() {
var toList = this;
toList.todos = [{name:'test 1'},{name:'test 2'}];
toList.example = function(v) {
v.name = 'ora bene';
};
});