Add toast to Date Time page

Change-Id: I0c0912f9d18fbb170ccf4863366b5973eb25050a
Signed-off-by: beccabroek <beccabroek@gmail.com>
diff --git a/app/configuration/controllers/date-time-controller.html b/app/configuration/controllers/date-time-controller.html
index 23a93d2..78d693b 100644
--- a/app/configuration/controllers/date-time-controller.html
+++ b/app/configuration/controllers/date-time-controller.html
@@ -64,7 +64,5 @@
       <button type="button" class="btn-primary inline" ng-click="setTime()">Save settings</button>
       <button type="button" class="btn-secondary inline" ng-click="refresh()">Cancel</button>
     </div>
-    <p class="success-msg" ng-show="success" role="alert">Success! Time changed!</p>
-    <p class="set_time_error error-msg" ng-show="error" role="alert">Error setting time!</p>
   </form>
 </div>
diff --git a/app/configuration/controllers/date-time-controller.js b/app/configuration/controllers/date-time-controller.js
index a08a141..826ae72 100644
--- a/app/configuration/controllers/date-time-controller.js
+++ b/app/configuration/controllers/date-time-controller.js
@@ -10,8 +10,8 @@
   'use strict';
 
   angular.module('app.configuration').controller('dateTimeController', [
-    '$scope', '$window', 'APIUtils', '$route', '$q',
-    function($scope, $window, APIUtils, $route, $q) {
+    '$scope', '$window', 'APIUtils', '$route', '$q', 'ngToast',
+    function($scope, $window, APIUtils, $route, $q, ngToast) {
       $scope.bmc = {};
       // Only used when the owner is "Split"
       $scope.host = {};
@@ -20,8 +20,6 @@
       // Possible time owners
       // https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Time/Owner.interface.yaml#L13
       $scope.timeOwners = ['BMC', 'Host', 'Both', 'Split'];
-      $scope.error = false;
-      $scope.success = false;
       $scope.loading = true;
       var timePath = '/xyz/openbmc_project/time/';
 
@@ -85,8 +83,6 @@
       });
 
       $scope.setTime = function() {
-        $scope.error = false;
-        $scope.success = false;
         $scope.loading = true;
         var promises = [setTimeMode(), setTimeOwner(), setNTPServers()];
 
@@ -123,11 +119,12 @@
               $q.all(manual_promises)
                   .then(
                       function() {
-                        $scope.success = true;
+                        ngToast.success('Date and time settings saved');
                       },
                       function(errors) {
                         console.log(JSON.stringify(errors));
-                        $scope.error = true;
+                        ngToast.danger(
+                            'Date and time settings could not be saved');
                       })
                   .finally(function() {
                     $scope.loading = false;
@@ -135,7 +132,7 @@
             },
             function(errors) {
               console.log(JSON.stringify(errors));
-              $scope.error = true;
+              ngToast.danger('Date and time settings could not be saved');
               $scope.loading = false;
             });
       };