0

你知道为什么刷新页面后第一个按钮动画不起作用吗?单击第一个按钮后,我们只能看到按钮阴影,但动画不起作用。提前谢谢你。

<!doctype html>

</div>
<button class="mdl-button mdl-js-ripple-effect mdl-js-button mdl-button--fab mdl-color--accent">
    <i class="material-icons mdl-color-text--white" role="presentation">add</i>
</button>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular-animate.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular-route.min.js"></script>
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.2/material.min.js"></script>
<script src="app.js"></script>

<button class="mdl-button mdl-js-ripple-effect mdl-js-button mdl-button--fab mdl-color--accent">
<i class="material-icons mdl-color-text--white" role="presentation">add</i>

var shaApp = angular.module('shaApp', ['ngAnimate','ngRoute']);
shaApp.config(['$routeProvider',
function($routeProvider) {
    $routeProvider.
    when('/', {
        templateUrl: 'dashboard.html',
        controller: 'dashboardCtrl',
    }).
    otherwise({
        redirectTo: '/'
    });
   }
]);
shaApp.controller('dashboardCtrl', ['$scope', '$http', function($scope, $http) {}}]);
4

1 回答 1

8

您可能需要升级动态元素(如此处所引用

shaApp.run(function($rootScope, $location, $timeout) {
    $rootScope.$on('$viewContentLoaded', function() {
        $timeout(function() {
            componentHandler.upgradeAllRegistered();
        });
    });
});

*[编辑] 修复拼写错误的单词

于 2015-08-04T21:06:17.007 回答