Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div ng-app="tutorialWebApp">
- <a href="#/home">Home</a><br />
- <a href="#/about">About</a><br />
- <div ng-view></div>
- </div>
- //angularjs
- <script>
- var app = angular.module('tutorialWebApp',['ngRoute']);
- app.config(function ($routeProvider,$locationProvider) {
- $routeProvider
- .when("/home", {templateUrl: "<?php echo site_url('Main/demo1');?>"})
- .when("/about", {templateUrl: "<?php echo site_url('Main/demo2');?>"})
- // else 404
- .otherwise({redirectTo: '/testview'});
- $locationProvider.html5Mode(true);
- });
- </script>
- function testing_route()
- {
- $this->load->view('admin/testing_route');
- }
- function demo1()
- {
- $this->load->view('admin/demo1');
- }
- function demo2()
- {
- $this->load->view('admin/demo2');
- }
- .when("/users", {templateUrl : "users/list_user"})
- .when("/create-user", {templateUrl : "users/create_user"})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement