http://jsfiddle.net/4nil/puw6huv4/
Here,
I am trying to inject ngroute dependency
var sampleApp = angular.module("sampleApp", ["ngRoute"]);
and trying to use routeprovider as below
sampleApp.config(["$routeProvider",
function($routeProvider) {
$routeProvider.
when("/addRomCom", {
templateUrl: "add_book.html",
controller: "romcomctrl"
}).
when("/addHorror", {
templateUrl: "add_book.html",
controller: "horrorctrl"
}).
otherwise({
redirectTo: "/"
});
}]);
The same code works in a standalone application, i have only one html which has script tag which has the code.