Skip to content

Instantly share code, notes, and snippets.

@SIRHAMY
Created July 23, 2015 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SIRHAMY/478a20ea8616622a64e4 to your computer and use it in GitHub Desktop.
Save SIRHAMY/478a20ea8616622a64e4 to your computer and use it in GitHub Desktop.
Basic Angular App setup with routing implementing ngRoute
angular.module('myApp', ['ngRoute']);
angular.module('myApp').config( function($routeProvider) {
$routeProvider
.when('/main', {
templateUrl: 'views/main.html',
controller: 'MainCtrl',
})
.otherwise({
redirectTo: '/main'
});
})
<html ng-app="myApp">
<title>Hello World!</title>
<body>
<div ng-view></div>
<!--Required Libraries-->
<script src="lib/angular.min.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment