這篇文章主要介紹Angular中Material怎么用,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
10年積累的成都做網(wǎng)站、網(wǎng)站設(shè)計(jì)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站制作后付款的網(wǎng)站建設(shè)流程,更有呼圖壁免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。Angular Material使用的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來(lái)看一下。
使用方法
用npm下載angular-material、angular-aria、angular-animate
代碼如下:
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" href="node_modules/angular-material/angular-material.css"></head><body ng-app="myApp" ng-controller="myCtrl" layout="column"> <md-toolbar> <h4>Angular Material 演示代碼</h4> </md-toolbar> <div class="container" layout="row" flex> <md-sidenav md-is-locked-open="true" class="md-whiteframe-z2"> <md-list> <md-list-item ng-repeat="item in arr"> <md-button ng-click="toggle($index)"> {{item.title}} </md-button> </md-list-item> </md-list> </md-sidenav> <md-content flex id="content" class="lightgreen" flex> <h3>{{rightTitle}}</h3> <p> {{rightCont}} </p> <md-checkbox ng-model="isChecked" aria-label="Finished?"> Finished ? </md-checkbox> <md-checkbox md-no-ink ng-model="hasInk" aria-label="No Ink Effects"> No Ink Effects </md-checkbox> <md-checkbox ng-disabled="true" ng-model="isDisabled" aria-label="Disabled"> Disabled </md-checkbox> <form name="colorForm"> <md-input-container> <label>Favorite Color</label> <input name="favoriteColor" ng-model="favoriteColor" required> <div ng-messages="colorForm.favoriteColor.$error"> <div ng-message="required">This is required!</div> </div> </md-input-container></form><md-progress-circular md-mode="determinate" value="80"></md-progress-circular><md-progress-circular md-mode="determinate" ng-value="60"></md-progress-circular><md-progress-circular md-mode="determinate" value="50" md-diameter="100"></md-progress-circular><md-progress-circular md-mode="indeterminate"></md-progress-circular><md-button class="md-fab md-accent" aria-label="Play"> <md-tooltip> Play Music </md-tooltip></md-button><div md-whiteframe="3"> <span>Elevation of 3dp</span></div> </md-content> </div> <script src="node_modules/angular/angular.min.js"></script> <script src="node_modules/angular-animate/angular-animate.min.js"></script> <script src="node_modules/angular-aria/angular-aria.min.js"></script> <script src="node_modules/angular-material/angular-material.js"></script> <script> var myApp = angular.module('myApp',['ngMaterial']); myApp.controller('myCtrl',['$scope',function($scope){ $scope.arr = [ {title:'標(biāo)題1',cont:'內(nèi)容1'}, {title:'標(biāo)題2',cont:'內(nèi)容2'}, {title:'標(biāo)題3',cont:'內(nèi)容3'}, {title:'標(biāo)題4',cont:'內(nèi)容4'} ]; $scope.toggle = function(id){ $scope.rightTitle = $scope.arr[id].title; $scope.rightCont = $scope.arr[id].cont; }; $scope.rightTitle = $scope.arr[0].title; $scope.rightCont = $scope.arr[0].cont; }]); </script></body></html>
以上是“Angular中Material怎么用”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)網(wǎng)站制作公司行業(yè)資訊頻道!
分享題目:Angular中Material怎么用-創(chuàng)新互聯(lián)
轉(zhuǎn)載來(lái)源:http://aaarwkj.com/article32/dgojpc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站維護(hù)、建站公司、網(wǎng)站設(shè)計(jì)公司、移動(dòng)網(wǎng)站建設(shè)、營(yíng)銷(xiāo)型網(wǎng)站建設(shè)
聲明:本網(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í)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容