AngularJS NG-电网开始减少? [英] AngularJS ng-Grid starts minimized?
问题描述
我使用纳克网格V2.0.7,问题是在第一时间即纳克网格表示,它被最小化。这里是我的意思的图片:
只有点击最小化表(上图)后,充分表显示正常(下图)..
这里是code我使用的是:
$ scope.gridOptions = {
数据:'jsonData.value',
多选:假的
};
为什么会出现这种情况?
编辑:这是在HTML文件中定义的:
< DIV CLASS =gridStyleNG-秀=(dataViewType =='表')NG-格=gridOptions>< / DIV>
尝试使用 NG-斗篷
指令网格元素。
例如一个简单的div:
< DIV NG-斗篷>< / DIV>
的ngCloak指令用于prevent的角度HTML模板
被简单地通过浏览器在其原始(未编译)显示
而您的应用程序加载形成。使用这个指令以避免
不良闪烁效应造成的HTML模板显示。
块引用>文档: http://docs.angularjs.org/api/ng.directive: ngCloak
I'm using ng-Grid v2.0.7, and the problem is that the first time that ng-grid shows, it is minimized. Here is a picture of what I mean:
Only after clicking on the minimized table (the top picture), the full table displays normally (the bottom picture).. Here is the code I'm using:
$scope.gridOptions = { data: 'jsonData.value', multiSelect: false };
Why is this happening?
EDIT: Here is the definition in the html file:
<div class="gridStyle" ng-show="(dataViewType == 'table')" ng-grid="gridOptions"></div>
解决方案Try to use the
ng-cloak
directive on your grid element.For example on a simple div :
<div ng-cloak></div>
"The ngCloak directive is used to prevent the Angular html template from being briefly displayed by the browser in its raw (uncompiled) form while your application is loading. Use this directive to avoid the undesirable flicker effect caused by the html template display."
Docs : http://docs.angularjs.org/api/ng.directive:ngCloak
这篇关于AngularJS NG-电网开始减少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!