-1

Help me with this plunk

http://plnkr.co/edit/9WSWSgp55j614tBd2qbJ?p=previewGo to above plunk and check it out pls

am getting blank screen when using routing but its working fine when its not

Nirmal kumar
  • 9
  • 1
  • 1

1 Answers1

4

Two things:

  1. You are declaring the main app module twice - once in app.js and once in the controller. The app.js one loads first, which adds the router as a dependency, but then in your controller you are doing this:

    var app=angular.module("githubviewer", []);

which redefines the githubviewer module, overwriting your previous one. To look up a module, simply leave off the second parameter (the array of dependencies). So change that line in your controller to be this instead:

var app=angular.module("githubviewer");
  1. You have the wrong module name for the router. The correct name is ngRoute:

https://docs.angularjs.org/api/ngRoute

Working plunk:

http://plnkr.co/edit/a3KHc2WIRMvGBDpFOwhX?p=preview

sma
  • 9,449
  • 8
  • 51
  • 80