I want define a controller when use module:
angular.module('todoList', [], function () {
}).controller('myCtrl', function ($scope) {
return function ($scope) {
$scope.todos = [
{
text: "Hello"
}, {
text: "World"
}
]
}
})
then I want use the module and the ccontroller:
<div ng-controller="myCtrl" ng-app="todoList">
<li ng-repeat="todo in todos">
<span>{{todo.text}}</span>
</li>>
</div>
but it render nothing, what's wrong with my code?