SHARE
TWEET

Untitled

a guest Dec 12th, 2014 189 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function () {
  2.  
  3.         var app = angular.module("app", ['ngAnimate', 'ui.router', 'angular-loading-bar']);
  4.  
  5.         app.config(function ($stateProvider, $urlRouterProvider) {
  6.                 $urlRouterProvider.otherwise("/404");
  7.  
  8.                 $stateProvider
  9.                         .state('home', {
  10.                                 url: "/",
  11.                                 templateUrl: "views/home.html",
  12.                                 controller: "postCtrl",
  13.                                 controllerAs: "post"
  14.                         })
  15.                         .state('about', {
  16.                                 url: "/about",
  17.                                 templateUrl: "views/about.html",
  18.                         })
  19.                         .state('contact', {
  20.                                 url: "/contact",
  21.                                 templateUrl: "views/contact.html",
  22.                         })
  23.                         .state('submit', {
  24.                                 url: "/submit",
  25.                                 templateUrl: "views/submit.html",
  26.                         })
  27.                         .state('404', {
  28.                                 url: "/404",
  29.                                 templateUrl: "views/404.html",
  30.                         });
  31.         });
  32.  
  33.         app.controller("postCtrl", ['$http', '$log',
  34.                 function ($http, $log, $location) {
  35.  
  36.                         var post2 = this;
  37.                         $http.get('/server/content.php').success(function (data) {
  38.                                 post2.response = data;
  39.                         });
  40.  
  41.                         this.isActive = function (route) {
  42.                                 return route === $location.path;
  43.                         };
  44.  
  45.         }]);
  46.  
  47. })();
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