-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of AngularJS and Angular UI Router powered MPA skeleton (seed project - work in progress)
- Loading branch information
Showing
17 changed files
with
34,223 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
target/ | ||
template/ | ||
.idea | ||
*.iml | ||
*.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 bushidowallet | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,28 @@ | ||
# angularjs-mpa-skeleton | ||
AngularJS Multiple Page Application Skeleton | ||
|
||
# required nginx server settings | ||
|
||
``` | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
if ( $request_filename ~ /index.html ) { | ||
rewrite ^ http://localhost/signin.html permanent; | ||
} | ||
location / { | ||
root html/app; | ||
index index.html; | ||
} | ||
location /signin { | ||
root html/app/modules/signin; | ||
} | ||
location /home { | ||
root html/app/modules/home; | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//redirect to signin module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var app = angular.module('app', ['ngCookies']); | ||
|
||
app.config(function($cookiesProvider) { | ||
$cookiesProvider.defaults.path = '/'; | ||
}); | ||
|
||
app.factory('appConfig', function () { | ||
var AppConfig = function () { | ||
|
||
}; | ||
AppConfig.prototype.init = function () { | ||
//set some properties; | ||
return this; | ||
} | ||
return new AppConfig(); | ||
}); | ||
|
||
app.factory('appModel', function () { | ||
var AppModel = function() { | ||
}; | ||
AppModel.prototype.init = function (data) { | ||
this.data = data; | ||
return this; | ||
} | ||
return new AppModel(); | ||
}); | ||
|
||
app.factory('appManager', function() { | ||
|
||
var model; | ||
var cookies; | ||
var persist = function() { | ||
cookies.put('data', model.data); | ||
} | ||
return { | ||
init: function ($cookieStore, $scope, appConfig, appModel) { | ||
$scope.model = appModel.init($cookieStore.get('data')); | ||
$scope.config = appConfig.init(); | ||
model = $scope.model; | ||
cookies = $cookieStore; | ||
save(); | ||
}, | ||
save: function () { | ||
persist(); | ||
} | ||
} | ||
}); |
Oops, something went wrong.