【发布时间】:2015-11-02 11:10:03
【问题描述】:
我在我的 AngularJS 应用程序中使用Material Design,我想在我的页面加载时添加一个进度条。
MD 使用md-progress-* 指令获取加载条:
<md-progress-linear md-mode="determinate" value="..."></md-progress-linear>
在我的应用中,我尝试在 $viewContentLoaded 上完成加载进度:
HTML:
<html ng-app="app">
<body ng-controller="AppCtrl">
<md-progress-circular ng-if="determinateValue === 100" md-mode="determinate" value="{{determinateValue}}"></md-progress-circular>
...
</body>
</html>
JS:
'use strict';
angular.module('app', ['ngMaterial', 'ngAnimate'])
.controller('AppCtrl', function ($scope) {
$scope.determinateValue = 0;
$scope.$on('$viewContentLoaded', function(){
$scope.determinateValue = 100;
});
});
但它不起作用,我没有收到任何错误。
ps。 <md-progress-linear> 标签从 DOM 中消失了。
【问题讨论】:
标签: javascript angularjs