add data services and login credential management
Change-Id: I196dca93bcd68c000fe54ecd6b07046d20347321
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/src/js/directives.js b/src/js/directives.js
index af78ae7..f8aae3d 100644
--- a/src/js/directives.js
+++ b/src/js/directives.js
@@ -10,7 +10,7 @@
'scope': {
'path': '='
},
- 'controller': ['$scope','dataService', function($scope, dataService){
+ 'controller': ['$scope','dataService', 'userModel', '$location', function($scope, dataService, userModel, $location){
$scope.server_status = 01;
$scope.dataService = dataService;
APIUtils.login(function(){
@@ -25,6 +25,11 @@
});
});
+ $scope.logout = function(){
+ userModel.logout();
+ $location.path('/logout');
+ }
+
$scope.refresh = function(){
console.log("--refresh status--");
}