Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
ca529169
Commit
ca529169
authored
May 14, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
routeProvider to app.js to lazyload modules
parent
0bae77f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
20 deletions
+29
-20
app.js
app/app.js
+21
-12
dashboard.js
app/dashboard/dashboard.js
+4
-4
login.js
app/login/login.js
+4
-4
No files found.
app/app.js
View file @
ca529169
'use strict'
;
'use strict'
;
// Declare app level module which depends on views, and components
// Declare app level module which depends on views, and components
angular
.
module
(
'zaerp'
,
[
angular
.
module
(
'ngRoute'
,
'zaerp'
,
[
'ngSanitize'
,
'ngRoute'
,
'ngAnimate'
,
'ngSanitize'
,
'ngQuantum'
,
'ngAnimate'
,
'zaerp.dashboard'
,
'ngQuantum'
,
'zaerp.login'
,
'zaerp.dashboard'
,
'zaerp.version'
,
'zaerp.login'
,
'schemaForm'
'zaerp.version'
,
]).
'schemaForm'
]).
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
console
.
log
(
"redirect to login"
);
$routeProvider
$routeProvider
.
otherwise
({
redirectTo
:
'/'
});
.
when
(
'/login'
,
{
templateUrl
:
'login/login.html'
,
controller
:
'LoginCtrl'
})
.
when
(
'/dashboard'
,
{
templateUrl
:
'dashboard/dashboard.html'
,
controller
:
'DashCtrl'
})
.
otherwise
({
redirectTo
:
'/dashboard'
});
}]).
}]).
run
(
function
(
$rootScope
,
$location
)
{
run
(
function
(
$rootScope
,
$location
)
{
$rootScope
.
$on
(
"$routeChangeStart"
,
function
(
event
,
next
,
current
)
{
$rootScope
.
$on
(
"$routeChangeStart"
,
function
(
event
,
next
,
current
)
{
...
...
app/dashboard/dashboard.js
View file @
ca529169
...
@@ -9,10 +9,10 @@
...
@@ -9,10 +9,10 @@
angular
.
module
(
'zaerp.dashboard'
,
[
'ngRoute'
])
angular
.
module
(
'zaerp.dashboard'
,
[
'ngRoute'
])
.
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
.
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
$routeProvider
.
when
(
'/dashboard'
,
{
//
$routeProvider.when('/dashboard', {
templateUrl
:
'dashboard/dashboard.html'
,
//
templateUrl: 'dashboard/dashboard.html',
controller
:
'DashCtrl'
//
controller: 'DashCtrl'
});
//
});
}])
}])
.
controller
(
'DashCtrl'
,
function
(
$scope
)
{
.
controller
(
'DashCtrl'
,
function
(
$scope
)
{
$scope
.
testData
=
"<h1>This is main Dashboard</h1>"
;
$scope
.
testData
=
"<h1>This is main Dashboard</h1>"
;
...
...
app/login/login.js
View file @
ca529169
...
@@ -6,10 +6,10 @@
...
@@ -6,10 +6,10 @@
var
login
=
angular
.
module
(
'zaerp.login'
,
[
'ngRoute'
,
'schemaForm'
]);
var
login
=
angular
.
module
(
'zaerp.login'
,
[
'ngRoute'
,
'schemaForm'
]);
login
.
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
login
.
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
$routeProvider
.
when
(
'/login'
,
{
//
$routeProvider.when('/login', {
templateUrl
:
'login/login.html'
,
//
templateUrl: 'login/login.html',
controller
:
'LoginCtrl'
//
controller: 'LoginCtrl'
});
//
});
}]);
}]);
login
.
controller
(
'LoginCtrl'
,
function
(
$scope
,
$http
,
$location
,
$rootScope
,
AUTH_EVENTS
,
LoginService
)
{
login
.
controller
(
'LoginCtrl'
,
function
(
$scope
,
$http
,
$location
,
$rootScope
,
AUTH_EVENTS
,
LoginService
)
{
$scope
.
schema
=
$scope
.
schema
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment