AngularJS Bootstrap alert dismiss-on-timeout attribute doesn't work

后端 未结 5 1664
春和景丽
春和景丽 2021-01-04 13:28

I\'m trying to use AngularJS Bootstrap alerts like explained here with the \"dismiss-on-timeout\" attribute. It has no effect in this example, the alert just appears regular

5条回答
  •  既然无缘
    2021-01-04 13:54

    The solution here is correct, however it is outdated so here is the updated version.

    In View: ( Updated in Angular UI Bootstrap )

    
      {{alert.msg}}
    
    

    In Controller:

    $scope.show = true;
    
       $scope.closeAlert = function() {
         $scope.show = false;
       };
    
        $scope.alert = {type: 'danger', msg: 'Something gone wrong'};
    

提交回复
热议问题