src/components/toast/toast.js
function MdToastController($mdToast, $scope, $log) {
    // For compatibility with AngularJS 1.6+, we should always use the $onInit hook in
    // interimElements. The $mdCompiler simulates the $onInit hook for all versions.
    this.$onInit = function() {
      var self = this;

      if (self.highlightAction) {
        $scope.highlightClasses = [
          'md-highlight',
          self.highlightClass
        ];
      }

      // If an action is defined and no actionKey is specified, then log a warning.
      if (self.action && !self.actionKey) {
        $log.warn('Toasts with actions should define an actionKey for accessibility.',
          'Details: https://material.angularjs.org/latest/api/service/$mdToast#mdtoast-simple');
      }

      if (self.actionKey && !self.actionHint) {
        self.actionHint = 'Press Control-"' + self.actionKey + '" to ';
      }

      if (!self.dismissHint) {
        self.dismissHint = 'Press Escape to dismiss.';
      }

      $scope.$watch(function() { return activeToastContent; }, function() {
        self.content = activeToastContent;
      });

      this.resolve = function() {
        $mdToast.hide(ACTION_RESOLVE);
      };
    };
  }
function MdToastController($mdToast, $scope, $log) {
    // For compatibility with AngularJS 1.6+, we should always use the $onInit hook in
    // interimElements. The $mdCompiler simulates the $onInit hook for all versions.
    this.$onInit = function() {
      var self = this;

      if (self.highlightAction) {
        $scope.highlightClasses = [
          'md-highlight',
          self.highlightClass
        ];
      }

      // If an action is defined and no actionKey is specified, then log a warning.
      if (self.action && !self.actionKey) {
        $log.warn('Toasts with actions should define an actionKey for accessibility.',
          'Details: https://material.angularjs.org/latest/api/service/$mdToast#mdtoast-simple');
      }

      if (self.actionKey && !self.actionHint) {
        self.actionHint = 'Press Control-"' + self.actionKey + '" to ';
      }

      if (!self.dismissHint) {
        self.dismissHint = 'Press Escape to dismiss.';
      }

      $scope.$watch(function() { return activeToastContent; }, function() {
        self.content = activeToastContent;
      });

      this.resolve = function() {
        $mdToast.hide(ACTION_RESOLVE);
      };
    };
  }
function MdToastController ( $mdToast , $scope , $log ) { // For compatibility with AngularJS 1.6+, we should always use the $onInit hook in // interimElements. The $mdCompiler simulates the $onInit hook for all versions. this . $onInit = function ( ) { var self = this ; if ( self . highlightAction ) { $scope . highlightClasses = [ 'md-highlight' , self . highlightClass ] ; } // If an action is defined and no actionKey is specified, then log a warning. if ( self . action && ! self . actionKey ) { $log . warn ( 'Toasts with actions should define an actionKey for accessibility.' , 'Details: https://material.angularjs.org/latest/api/service/$mdToast#mdtoast-simple' ) ; } if ( self . actionKey && ! self . actionHint ) { self . actionHint = 'Press Control-"' + self . actionKey + '" to ' ; } if ( ! self . dismissHint ) { self . dismissHint = 'Press Escape to dismiss.' ; } $scope . $watch ( function ( ) { return activeToastContent ; } , function ( ) { self . content = activeToastContent ; } ) ; this . resolve = function ( ) { $mdToast . hide ( ACTION_RESOLVE ) ; } ; } ; }
Controller for the Toast interim elements.
@ngInject
Controller for the Toast interim elements .