From 52f725a820014fec9b7fd3ccbdfd9f2bc1f9f3ac Mon Sep 17 00:00:00 2001 From: Alex Marchenko Date: Mon, 2 Nov 2015 17:48:10 +0700 Subject: [PATCH] Routing fix --- app/404.html | 23 +++++++++++++++++++++++ app/app.js | 4 ++-- package.json | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 app/404.html diff --git a/app/404.html b/app/404.html new file mode 100644 index 0000000..acca803 --- /dev/null +++ b/app/404.html @@ -0,0 +1,23 @@ + + + + + + + HTML5 роутинг в AngularJS + + + + + + +
+ + + + + + diff --git a/app/app.js b/app/app.js index fcbbdd9..4a065a3 100644 --- a/app/app.js +++ b/app/app.js @@ -5,10 +5,10 @@ angular.module('myApp', ['ngRoute']).config(function($routeProvider, $locationPr $locationProvider.html5Mode(true); $routeProvider.when('/view1', { - templateUrl: '/app/view1/view1.html' + templateUrl: '/view1/view1.html' }); $routeProvider.when('/view2', { - templateUrl: '/app/view2/view2.html' + templateUrl: '/view2/view2.html' }); $routeProvider.otherwise({redirectTo: '/view1'}); diff --git a/package.json b/package.json index 6a35a6b..a17ad05 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "postinstall": "bower install", "prestart": "npm install", - "start": "http-server -a localhost -p 8000 -c-1", + "start": "http-server ./app -a localhost -p 8000 -c-1", "pretest": "npm install",