SHARE
TWEET

Untitled

a guest Dec 12th, 2014 193 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function () {
  2.  
  3.         var app = angular.module("app", ['ngAnimate', 'ngRoute', 'angular-loading-bar']);
  4.  
  5.         app.config(['$routeProvider', '$locationProvider',
  6.                 function ($routeProvider, $locationProvider) {
  7.                         $routeProvider
  8.                                 .when('/', {
  9.                                         templateUrl: "views/home.html",
  10.                                         controller: "postCtrl",
  11.                                         controllerAs: "post"
  12.                                 })
  13.                                 .when('/about', {
  14.                                         templateUrl: "views/about.html"
  15.                                 })
  16.                                 .when('/contact', {
  17.                                         templateUrl: "views/contact.html"
  18.                                 })
  19.                                 .when('/submit', {
  20.                                         templateUrl: "views/submit.html"
  21.                                 })
  22.                                 .when('/read/:postid', {
  23.                                         templateUrl: "views/read.html"
  24.                                 })
  25.                                 .otherwise({
  26.                                         templateUrl: "views/404.html"
  27.                                 });
  28.  
  29.                         $locationProvider.html5Mode(true);
  30.         }]);
  31.  
  32.         app.controller("postCtrl", ['$http', '$log',
  33.                 function ($http, $log, $location) {
  34.  
  35.                         var post2 = this;
  36.                         $http.get('/server/content.php').success(function (data) {
  37.                                 post2.response = data;
  38.                         });
  39.  
  40.                         this.isActive = function (route) {
  41.                                 return route === $location.path;
  42.                         };
  43.  
  44.         }]);
  45.  
  46. })();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top