angularjs - Angular JS 的 Material Design Lite 渲染问题

标签 angularjs material-design angular-material

我在使用 Material Design Lite ( getmdl.io ) 时遇到了一些问题。我按照 getmdl.io web 中显示的步骤进行安装(实际上我使用 bower),但是我总是遇到同样的问题,当我更改 web 中的 ng-route 时,某些资源无法正确呈现,例如,我需要重新加载页面以使其正确呈现。

首先我有这个:

bad render

然后当我重新加载时,我得到了我想要的:

enter image description here

我无法理解的是为什么其他资源(例如 google 图标或按钮)可以正常工作,但导航栏上的菜单按钮和其他资源(例如此类资源)需要重新加载页面才能正确呈现。

我尝试使用托管方法和凉亭方法包含库。

知道发生了什么吗?

最佳答案

我在我的代码中过去了这个函数

angular.module('app', ['ngRoute']).

    run(function($rootScope, xxxx, xxx){
        $rootScope.$on('$viewContentLoaded', function(event, next) {
            componentHandler.upgradeAllRegistered();
        });
    });

它工作完美!祝你好运..

关于angularjs - Angular JS 的 Material Design Lite 渲染问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32418580/

相关文章:

javascript - AngularJS 不以与常规 HTML 相同的方式应用 CSS?

javascript - 读取html表绑定(bind)中ng-repeat内隐藏字段的值

angularjs - Material Design Angular md-自动完成远程

reactjs - Material-ui:AppBar:将图像高度限制为AppBar高度的策略?

javascript - 'string' 类型的参数不可分配给 'AbstractControl' 类型的参数。 Angular react 形式

javascript - 无法使用 Wcf 服务在 Angular JS 中根据 ID 检索单个记录

asp.net - 在没有 Node 的情况下安装 npm

html - 标签元素 CSS 下的形状(线)

angular - 仅将 Angular Material 主题应用于特定组件

html - 带有居中图标的 Angular Material mat-nav-list 多行