Commit 73ee4356 authored by Evren Kutar's avatar Evren Kutar

init - load dashboard view & controller & test

parent eafc40c8
'use strict';
// Declare app level module which depends on views, and components
angular.module('zaerp', ['ngRoute', 'zaerp.login', 'zaerp.view2', 'zaerp.version', 'schemaForm']).
angular.module('zaerp', ['ngRoute', 'zaerp.dashboard', 'zaerp.login', 'zaerp.version', 'schemaForm']).
config(['$routeProvider', function ($routeProvider) {
console.log("redirect to login");
$routeProvider.otherwise({redirectTo: '/view2'});
$routeProvider.otherwise({redirectTo: '/'});
}]).
run(function ($rootScope, $location) {
$rootScope.$on("$routeChangeStart", function (event, next, current) {
......
<div ng-app="zaerp.dashboard">
<div class="starter-template" ng-controller="DashCtrl">
<h1>Main Dashboard</h1>
{{ testData }}
</div>
</div>
\ No newline at end of file
/**
* Created by evren kutar on 12/05/15.
*/
'use strict';
// TODO: clean console log items
angular.module('zaerp.dashboard', ['ngRoute'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/dashboard', {
templateUrl: 'dashboard/dashboard.html',
controller: 'DashCtrl'
});
}])
.controller('DashCtrl', function ($scope) {
$scope.testData = "<h1>This is main Dashboard</h1>";
});
\ No newline at end of file
......@@ -24,7 +24,6 @@
<div class="container">
<ul class="menu">
<li><a href="#/login">login</a></li>
<li><a href="#/view2">view2</a></li>
</ul>
<!--[if lt IE 7]>
......@@ -53,7 +52,7 @@
<script src="app.js"></script>
<script src="login/login.js"></script>
<script src="view2/view2.js"></script>
<script src="dashboard/dashboard.js"></script>
<script src="components/version/version.js"></script>
<script src="components/version/version-directive.js"></script>
<script src="components/version/interpolate-filter.js"></script>
......
......@@ -62,7 +62,7 @@ angular.module('zaerp.login', ['ngRoute', 'schemaForm'])
console.log(form);
if (form.$valid){
$rootScope.loggedInUser = true;
$location.path("/view2");
$location.path("/dashboard");
//$http.post('http://127.0.0.1:8003/#/login', form.email).
// success(function(data, status, headers, config){
// console.log(data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment