Configuration for tagwise page Display - AngularJS


/ Published in: JavaScript
Save to your folder(s)

Config for Single page application


Copy this code and paste it in your HTML
  1. .config(function ($routeProvider, $locationProvider) {
  2. $routeProvider
  3. .when("/", {
  4. templateUrl: 'template/initial.php',
  5. controller: 'mp3Ctrl'
  6. })
  7. .when("/Search/:searchTerm", {
  8. templateUrl: 'template/result.php',
  9. controller: 'searchCtrl'
  10. })
  11. .otherwise({redirectTo: ''});
  12.  
  13. $locationProvider.html5Mode(true); //For removing # from url
  14. })

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.