Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

checklist-model module does not work when using ng-route

I was trying to use [checklist-model] (https://github.com/vitalets/checklist-model) module in my app but I caught an error that I have figured out it was because of using (ngRoute) module in the same app.

var mainMod = angular.module('MainApp', ['ngRoute'],['checklist-model']);

mainMod.config(['$routeProvider',function($routeProvider) {

        $routeProvider
            .when("/patient-list", {
                templateUrl: "patient-list.html",
                            controller: "dbCtrl"

            })
            .when("/patientRecord", {
                templateUrl: "patientRecord.html",
                controller: "MainCtrl2"
            })
            .otherwise({
                templateUrl: "patient-list.html",
                            controller: "dbCtrl"

            })

    }

]);

The error:

angular.min.js:6Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.24/$injector/modulerr?p0=MainApp&p1=Error%3…%20gc%20(http%3A%2F%2Flocalhost%2Ftest%2Ffiles%2Fangular.min.js%3A36%3A309)

If there is any solution for this I will be happy to know.

Thanks for your efforts

like image 506
t.tah Avatar asked Apr 10 '26 08:04

t.tah


1 Answers

The second parameter is supposed to be an array of all of your dependencies. Try angular.module('MainApp', ['ngRoute', 'checklist-module']); instead.

Also, using the unminified version for your development work will produce more useful error messages.

like image 188
10BitDev Avatar answered Apr 13 '26 01:04

10BitDev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!