Im using the following code and the 'firebaseDetailCtrl' is throwing an error on page:
Error: [$injector:unpr] Unknown provider: dataProvider <- data <- firebaseDetailCtrl
I'm not an expert, I know there are other explainations of this, but i cant find a logical solution and some help.
'use strict';
var myApp = angular.module('myApp', ['firebase', 'ngRoute']);
myApp.controller("todoCtrl", function($scope, $firebaseObject) {
var ref = firebase.database().ref();
// download the data into a local object
$scope.data = $firebaseObject(ref);
});
myApp.controller('firebaseDetailCtrl', ['$scope', '$routeParams', 'data',
function($scope, $routeParams, data) {
$scope.url = $routeParams.id;
$scope.todoWork2 = data.query();
}]);
myApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/projects/:id', {
templateUrl: 'partials/firebase-details.html',
controller: 'firebaseDetailCtrl'
}).
when('/projects', {
templateUrl: 'partials/firebase-items.html',
controller: 'todoCtrl'
}).
otherwise({
redirectTo: '/projects'
});
}]);