Skip to content

Instantly share code, notes, and snippets.

@rn1d
Created July 16, 2014 20:12
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 rn1d/763c790de0a9f24fef29 to your computer and use it in GitHub Desktop.
Save rn1d/763c790de0a9f24fef29 to your computer and use it in GitHub Desktop.
(function () {
'use strict';
var baseUrl = $('base').attr('href');
var appBaseUrl = baseUrl + 'scripts/myApp/';
angular.module('myApp', ['ngRoute'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.
when('/list', {
templateUrl: appBaseUrl + 'partials/list.html',
controller: 'ListController'
}).
when('/details', {
templateUrl: appBaseUrl + 'partials/details.html',
controller: 'DetailsController'
}).
otherwise({
redirectTo: '/list'
});
}]);
})();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href='@Url.Content("~/")'>
<title>@ViewBag.Title - My ASP.NET Application</title>
<!-- ... -->
</head>
<body>
<!-- ... -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment