module Sfx { export interface IEventsViewScope extends angular . IScope { dataService : DataService ; } export class StatusWarningsDirective implements ng . IDirective { public restrict = "E" ; public templateUrl = "partials/status-warnings.html" ; public controller = StatusWarningController ; public controllerAs = "ctrl" ; public scope = { dataService : "=" } ; public link ( $scope , element , attributes ) { } } export class StatusWarningController { static $inject = [ "$scope" , "data" ] ; alerts : StatusWarningService ; displayAll = false ; constructor ( private $scope , private data ) { this . alerts = this . data . warnings ; } public toggleViewed ( ) { this . displayAll = ! this . displayAll ; } public remove ( alert , hidePermenantly = false ) { this . alerts . removeNotificationById ( alert . id , hidePermenantly ) ; } public removeWithConfirm ( alert ) { new ActionWithConfirmationDialog ( this . data . $uibModal , this . data . $q , "" , "Accept" , "acknowledge" , ( ) => this . data . $q . when ( this . alerts . removeNotificationById ( alert . id , true ) ) , ( ) => true , "Acknowledge" , alert . confirmText , "Accept" ) . runWithCallbacks ( ( ) => null , ( ) => { } ) ; } } }