Skip to content

Instantly share code, notes, and snippets.

@xaiwant
Created May 31, 2018 01:10
Show Gist options
  • Save xaiwant/b55b46d3d573837b5afa7fa9a71cf6ba to your computer and use it in GitHub Desktop.
Save xaiwant/b55b46d3d573837b5afa7fa9a71cf6ba to your computer and use it in GitHub Desktop.
var myApp = angular.module("myApp", ["ngRoute"]);
myApp.config(function($routeProvider) {
$routeProvider
.when("/about", {
template: '<p>Angular Page with route</p>'
})
.when("/careers", {
templateUrl : "careers.htm"
})
.when("/career", {
templateUrl : "career.htm",
controller: 'routecntrl'
})
});
myApp.controller('routecntrl', function($scope) {
$scope.result = "Welcome to AngularJS Application with routes technique with templateUrl parameter.";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment