欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

使用AngularJS怎么實(shí)現(xiàn)一個(gè)全局警告框-創(chuàng)新互聯(lián)

今天就跟大家聊聊有關(guān)使用AngularJS怎么實(shí)現(xiàn)一個(gè)全局警告框,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比麻山網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式麻山網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋麻山地區(qū)。費(fèi)用合理售后完善,10余年實(shí)體公司更值得信賴。

具體如下:

<!DOCTYPE html>
<html lang="zh-CN">
 <head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bootstrap.min.css" rel="external nofollow" >
  <script src="jquery.min.js"></script>
  <script src="angular.js"></script>
  <script src="angular-animate.js"></script>
  <script src="bootstrap.min.js"></script>
  <script type="text/javascript">
    var myapp = angular.module('myapp', ['ngAnimate']);
    myapp.controller('msgController', ['$scope', 'notificationService', function($scope, notificationService) {
      $scope.msg = notificationService;
      $scope.show = function() {
        notificationService.danger('success');
      }
    }]);
    myapp.controller('controller', ['$scope', 'notificationService', function($scope, notificationService) {
      $scope.show = function() {
        notificationService.info('info');
      }
    }]);
    myapp.directive('msgBox', function() {
      return {
        restrict : 'EA',
        scope : {
          content: '@',
          type: '@',
        },
        templateUrl : 'tmpl.html',
        link : function(scope, elem, attrs) {
          scope.close = function() {
            scope.content = '';
          };
        }
      };
    });
    myapp.factory('notificationService', function($timeout, $rootScope) {
      return {
        content : '',
        type : '',
        success : function(content) {
          this.tmpl(content, 'success')
        },
        info : function(content) {
          this.tmpl(content, 'info')
        },
        warning : function(content) {
          this.tmpl(content, 'warning')
        },
        danger : function(content) {
          this.tmpl(content, 'danger')
        },
        tmpl : function(content, type) {
          this.content = content;
          this.type = type;
          var _self = this;
          $timeout(function() {
            _self.clear();
          }, 5000);
        },
        clear : function() {
          this.content = '';
          this.type = '';
        }
      };
    });
  </script>
  <style type="text/css">
    .msg-box {
      z-index: 666;
      position: absolute;
      width: 100%;
      top: 5px;
    }
    .msg.ng-enter {
      transition: 2s linear all;
      opacity: 0.3;
    }
    .msg.ng-enter-active {
      opacity: 1;
    }
    .msg.ng-leave {
      transition: 2s linear all;
      opacity: 1;
    }
    .msg.ng-leave-active {
      opacity: 0;
    }
  </style>
 </head>
 <body ng-app="myapp" ng-controller="msgController">
   <msg-box content="{{msg.content}}" type="{{msg.type}}" class="msg-box">
   </msg-box>
   <h2>content</h2>
   <button type="button" class="btn btn-primary" ng-click="show()">success</button>
   <div ng-controller="controller">
    <button type="button" class="btn btn-primary" ng-click="show()">info</button>
   </div>
 </body>
</html>
<div class="alert alert-{{type || 'info'}} msg" role="alert" ng-if="content">
 <button type="button" class="close" aria-label="Close" ng-click="close()">
  <span aria-hidden="true">&times;</span>
 </button>
 {{content}}
</div>

看完上述內(nèi)容,你們對(duì)使用AngularJS怎么實(shí)現(xiàn)一個(gè)全局警告框有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司行業(yè)資訊頻道,感謝大家的支持。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)建站aaarwkj.com,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

當(dāng)前文章:使用AngularJS怎么實(shí)現(xiàn)一個(gè)全局警告框-創(chuàng)新互聯(lián)
URL網(wǎng)址:http://aaarwkj.com/article48/pesep.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供虛擬主機(jī)、域名注冊(cè)、網(wǎng)站建設(shè)、網(wǎng)站改版、ChatGPT、電子商務(wù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司
午夜福利中文字幕在线亚洲| 国产亚洲av看码精品永久| 在线日韩观看免费av| 日本黄网色三级三级三级| 亚洲国产99在线精品一区| 乱色熟女一区二区三区| 男人午夜激情免费网站| 一区二区三区国产精品乱码| 妇女人妻丰满少妇中文字幕| 亚洲av天堂一区二区香蕉| 亚洲精品??一区二区| 日本免费在线不卡一区二区| 欧美高清一区二区三区不卡| 国产乡下三级_三级全黄| av免费在线不卡观看| 国产丝袜美腿视频亚洲综合| 亚洲欧美国产日韩另类| 日本成熟妇高潮视频在线观看不卡| 亚洲,日韩,欧美久久综合| 国产精品一区二区免费式| 国产精品无卡无在线播放| 在线日韩中文字幕二区| 日本女同一区二区高清| 国产91对白在线观看| 亚洲国产精品久久久久久99| 国产精品亚洲欧美日韩综合| 美女张开腿让男人插进去| 青青草青青草在线观看视频| 极品人妻视频中文字幕| 国产精品黄色av一区二区| 精品人妻一区二区三区不卡| 丰满少妇一区二区三区在线观看 | 日韩无码一区二区视频| 欧美aⅴ精品一区二区三区| 高清不卡av在线播放| 日韩人妻中文字幕乱码一区| av剧情在线观看免费| 国产欧美日韩精品国产| av一区二区三区高潮| 精品中文字幕欧美区一区| 欧美日韩亚洲1区2区|