Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- how to pass resolved stuff (lists) to controller?
- $stateProvider
- .state('lists', {
- url: '/lists',
- templateUrl: 'partials/lists.html',
- resolve: {
- lists: function ($http) {
- return $http.get('/lists')
- .then(function (response) {
- return response.data;
- });
- }
- },
- controller: 'listsCtrl'
- })
- //this is controller
- angular.module('teamList').controller('listsCtrl', ['$scope', '$location', '$http', 'lists', <- injection error*
- function ($scope, $location, $http, lists) {
- ...
- * https://docs.angularjs.org/error/$injector/unpr?p0=listsProvider%20<-%20lists%20<-%20listsCtrl
- если не прописывать там 'lists', листы будут андефайнд
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement