Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <div ng-app="tutorialWebApp">
  2. <a href="#/home">Home</a><br />
  3. <a href="#/about">About</a><br />
  4.  
  5. <div ng-view></div>
  6. </div>
  7.  
  8.  
  9. //angularjs
  10.  
  11. <script>
  12. var app = angular.module('tutorialWebApp',['ngRoute']);
  13. app.config(function ($routeProvider,$locationProvider) {
  14. $routeProvider
  15.  
  16. .when("/home", {templateUrl: "<?php echo site_url('Main/demo1');?>"})
  17.  
  18. .when("/about", {templateUrl: "<?php echo site_url('Main/demo2');?>"})
  19.  
  20. // else 404
  21. .otherwise({redirectTo: '/testview'});
  22. $locationProvider.html5Mode(true);
  23.  
  24. });
  25. </script>
  26.  
  27. function testing_route()
  28. {
  29. $this->load->view('admin/testing_route');
  30. }
  31.  
  32. function demo1()
  33. {
  34. $this->load->view('admin/demo1');
  35. }
  36. function demo2()
  37. {
  38. $this->load->view('admin/demo2');
  39. }
  40.  
  41. .when("/users", {templateUrl : "users/list_user"})
  42.  
  43. .when("/create-user", {templateUrl : "users/create_user"})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement