AngularJS via controller A to controller B
高洛峰
高洛峰 2017-05-15 17:00:59
0
4
535

First enter controller A
Then decide whether to display controller A's dom or directly display controller B's dom
But no matter how you do it, you will first render A's dom and then flash it before entering B's dom. Can anyone give me some advice?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(4)
为情所困

Generally used in this situationng-if

PHPzhong

Controller itself has no DOM. Do you mean ng-controller, component, directive or route?

大家讲道理

Go to Angular’s ​​class library and find a file named angular-csp and import it. The content is like this

/* Include this file in your html if you are using the CSP mode. */

@charset "UTF-8";

[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],
.ng-cloak, .x-ng-cloak,
.ng-hide:not(.ng-hide-animate) {
  display: none !important;
}

ng\:form {
  display: block;
}

.ng-animate-shim {
  visibility:hidden;
}

.ng-anchor {
  position:absolute;
}

Then add ng-cloakattributes to your flash elements

<p ng-if="false" ng-cloak>Hello World</p>
洪涛

I agree with the first floor. To judge the display of DOM, use ng-if directly on the HTML page. If the result is true, the DOM will be rendered. If not, it will not be rendered.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template