0
我有一個有2000行JQuery腳本的模板。最初我用角度版本1獲得它,它在那裏完美的工作,但是當在Angular 4上導入它時似乎沒有在文檔準備好時加載JQuery。jQuery腳本沒有加載Angular v4
在文件的最後,我有:
(function($) {
'use strict';
// Initialize layouts and plugins
(typeof angular === 'undefined') && $.Pages.init();
})(window.jQuery);
也許一些相關的角版本或類似的東西。還沒搞清楚。
不是100%肯定之後,但我認爲只有角1使用jQuery引擎蓋下,當新版本不那麼它的可能jQuery不再可用,你必須自己提供。 – GillesC
我可以輕鬆地在Angular 2指令上使用JQuery。我認爲有一些方法可以調用符合新版本要求的init方法。 –