Guest User

Untitled

a guest
Feb 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <base href="/" />
  2. <h1> index</h1>
  3.  
  4. <a href="/login">login</a>
  5.  
  6. var App = angular.module('myApp', ['ui.router']);
  7.  
  8. App.controller("loginController", LoginController);
  9.  
  10. App.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
  11.  
  12. $stateProvider
  13. .state('login', {
  14. url: '/login',
  15. templateUrl: '../views/home/login',
  16. controller: LoginController,
  17. controllerAs: 'controller'
  18. })
  19. $urlRouterProvider.otherwise('/');
  20.  
  21.  
  22. });
  23.  
  24. public class RouteConfig
  25. {
  26. public static void RegisterRoutes(RouteCollection routes)
  27. {
  28. routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  29.  
  30. routes.MapRoute(
  31. name: "Default",
  32. url: "{controller}/{action}/{id}",
  33. defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  34. );
  35. }
  36. }
  37.  
  38. <body ng-app="myApp">
  39.  
  40. <a ui-sref="login">login</a>
Add Comment
Please, Sign In to add comment