Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var appMainModule = angular.module('appMain', [ 'firebase','ngRoute'])
- .config(function ($routeProvider, $locationProvider) {
- $routeProvider.when('/', { templateUrl: '/Templates/CustomerLogin.html', controller: 'HomeCtrl' });
- $routeProvider.when('/customer/home', { templateUrl: '/Templates/CustomerHome.html' , controller:'ForLogout'});
- $routeProvider.when('/customer/singup', { templateUrl: '/Templates/CustomerSinup.html', controller: 'RegisterCtrl' });
- $routeProvider.when('/dashboard/godash', { templateUrl: '/Templates/dashboard.html', controller: 'DashboardCtrl' });
- $routeProvider.when('/customer/list', { templateUrl: '/Templates/CustomerList.html', controller: 'customerListViewModel' });
- $routeProvider.when('/customer/detail', { templateUrl: '/Templates/CustomerDetail.html', controller: 'customerDetailViewModel' });
- $routeProvider.when('/customer/googlemap', { templateUrl: '/Templates/GoogleMap.html', controller: 'MapCtrl' });
- // $routeProvider.when('/customer/postdata', { templateUrl: '/Templates/CustomerPostData.html', controller: 'AddPostCtrl' });
- $routeProvider.when('/customer/getdata', { templateUrl: '/Templates/CustomerGetData.html', controller: 'GetCtrl', reloadOnSearch: false });
- $routeProvider.when('/victim/getdata', { templateUrl: '/Templates/RiskVictimDetail.html', controller: 'VictimGetCtrl' });
- $routeProvider.otherwise({ redirectTo: '/' });
- $locationProvider.html5Mode(true);
- });
- appMainModule.controller('HomeCtrl', ['$scope', '$location', 'CommonProp', '$firebaseAuth', function ($scope, $location,CommonProp, $firebaseAuth) {
- var firebaseObj = new Firebase("FireaseURL/");
- loginObj = $firebaseAuth(firebaseObj);
- $scope.user = {};
- var login = {};
- $scope.SignIn = function (e) {
- login.loading = true;
- e.preventDefault();
- var username = $scope.user.email;
- var password = $scope.user.password;
- loginObj.$authWithPassword({
- email: username,
- password: password
- })
- .then(function (user) {
- //Success callback
- // alert('Authentication successful');
- login.loading = false;
- $location.path('/dashboard/godash')
- }, function (error) {
- //Failure callback
- alert('Authentication failure');
- });
- }
- }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement