Romanovich095

Angular Routes

Sep 14th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var ngTestApp = angular.module('angularTestApp', ['ngRoute']);
  2.  
  3. ngTestApp.config(function ($routeProvider) {
  4.     $routeProvider.when('/:page', {
  5.         templateUrl: function (url) {
  6.             return '/views/' + url.page + '.html'
  7.         }
  8.     })
  9.         .otherwise('/', {
  10.             templateUrl: 'index.html'
  11.         });
  12. });
  13.  
  14. ngTestApp.controller('ContentController', function ($scope, $http) {
  15.    
  16. });
Advertisement
Add Comment
Please, Sign In to add comment