Advertisement
jbjares

Untitled

Apr 3rd, 2015
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @scripts.jade
  2. --
  3. script(src="./vendor/jquery/dist/jquery.js")
  4. script(src="./vendor/angular/angular.js")
  5. script(src="./vendor/angular-resource/angular-resource.js")
  6. script(src="./vendor/angular-route/angular-route.js")
  7. script(src="./app/app.js")
  8.  
  9.  
  10. @scripts.html
  11. --
  12. <!DOCTYPE html><script src="/vendor/jquery/dist/jquery.js"></script><script src="/vendor/angular/angular.js"></script><script src="/vendor/angular-resource/angular-resource.js"></script><script src="/vendor/angular-route/angular-route.js"></script><script src="/app/app.js"></script>
  13.  
  14.  
  15. @layout.jade
  16. --
  17. doctype
  18. html
  19.    head
  20.       link(href="/favicon.ico", rel="shortcut icon", type="image/x-icon")
  21.       link(rel="stylesheet", href="/css/bootstrap.css")
  22.       link(rel="stylesheet", href="/vendor/toastr/toastr.css")
  23.       link(rel="stylesheet", href="/css/site.css")
  24.    body(ng-app='app')
  25.       block main-content
  26.       include scripts
  27.  
  28.  
  29. PS.: I changed the code below @app.js:
  30. angular.module('app',['ngResource','ngRoute']);
  31.  
  32. angular.module('app').config(function($routeProvider,$locationProvider){
  33.     $locationProvider.html5Mode({  //It was just: $locationProvider.html5Mode(true);
  34.         enabled: true,
  35.         requireBase: false
  36.     });
  37.  
  38.     $routeProvider
  39.         .when('/',{templateUrl:'/partials/main',controller:'mainCtrl'});
  40.  
  41.  
  42. });
  43.  
  44. angular.module('app').controller('mainCtrl',function($scope){
  45.     $scope.myVar = "Hello Angular";
  46. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement