user1177842 user1177842 - 5 months ago 20
AngularJS Question

ngRoute not working when changing module

i am working with ngRoute. currently i am using ng-table plugin and jcs-autovalidation plugin. Therefore my module,

var app = angular.module("myApp", ['ngTable','jcs-autoValidate']);

problem is ngRoute not working with above module. when using like below,

var app = angular.module("myApp");

ngRoute is working well. how i use ngRoute with my plugins

Answer Source

Try to use one module for your application, and add all the necessary dependencies to it,

var app = angular.module('myApp', ['ngRoute','ngTable','jcs-autoValidate']);

So that you do not have to declare the module again,

app.directive('mydatepicker', function () {