AngularJS战略,以prevent闪光的,无样式内容的一类 [英] AngularJS strategy to prevent flash-of-unstyled-content for a class

查看:221
本文介绍了AngularJS战略,以prevent闪光的,无样式内容的一类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个AngularJS项目,我在一个类名页面加载过程中要prevent一个FOUC。我读过有关NG-模板,但只在一个标签中的内容似乎是有用的。

I have an AngularJS project, I want to prevent a FOUC during page load on a classname. I've read about ng-template but that seems useful only for content within a tag.

<body class="{{ bodyClass }}">

我想它是在页面加载登录。任何策略呢?或者,我只是捏造,并加载它作为登录,然后手动使用JavaScript来调整DOM只是该实例。

I would like it to be "login" on page load. Any strategy for this? Or do I just have to fudge it and load it as 'login' and manually use javascript to to tweak the DOM just for this instance.

推荐答案

你所寻找的是 NG-斗篷。结果
你必须添加这样的:

What you are looking for is ng-cloak.
You have to add it like this:

<body class="{{ bodyClass }}" ng-cloak>

这将prevent不必要的闪烁。结果
链接到文件这一点。

这篇关于AngularJS战略,以prevent闪光的,无样式内容的一类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆