Onsen-UI无法加载< ons>流星中的标签 [英] Onsen-UI cannot load <ons> tags in Meteor

查看:120
本文介绍了Onsen-UI无法加载< ons>流星中的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试移动Onsen UI的头像样式( http://onsen.io/pattern- list_avatars.html )添加到Meteor应用中,但不会加载标签.来自Onsen的Firebug记录消息:

I am trying to move avatars pattern of Onsen UI (http://onsen.io/pattern-list_avatars.html) into a Meteor app, but the tags do not load. Firebug logged message from Onsen:

Onsen UI需要jqLit​​e.在加载AngularJS之后加载jQuery以修复此错误. jQuery可能会破坏Onsen UI行为.

Onsen UI require jqLite. Load jQuery after loading AngularJS to fix this error. jQuery may break Onsen UI behavior.

即使我安装了jquery软件包,也会出现此消息,为了消除它,我必须将jquery lib包含在client/lib文件夹中(不知道那是正确的).

This message appeared even though I had jquery package installed and in order to eliminate it I have to include jquery lib into client/lib folder (do not know if that is correct).

我还向我的项目中添加了urigo:angular软件包,因为Onsen需要Angular,但这并不能解决问题.现在,我在日志中收到的唯一消息是

I have also added urigo:angular package into my project because Onsen requires Angular but that did not do the trick. Now the only message I get in the log is

警告:试图多次加载角度.

WARNING: Tried to load angular more than once.

这是从温泉代码中提取的:

Which is taken from Onsen code:

if (window.angular.bootstrap) {
//AngularJS is already loaded, so we can return here...
console.log('WARNING: Tried to load angular more than once.');
return;
}

样式不适用于元素,它们看起来如下:

The styling is not applied to elements and they look the following:

我该如何解决?

推荐答案

Onsen .js文件需要与jQuery文件和Angular文件一起以正确的顺序加载.为了在Meteor中实现此目的,我将这些文件加载​​到client/lib文件夹中,如下所示:

Onsen .js files need to be loaded in a correct order together with jQuery file and Angular file. To achieve this in Meteor I loaded these files in client/lib folder like this:

root
  |- client
    |- lib
     - onsen.js
      |- jQuery
       - jquery.min.js
        |- Angular
         - angular.min.js

以这种方式加载解决了问题,因为流星加载文件从文件夹树的最深节点开始,在本例中为/Angular文件夹.

Loading in this way solved the problem because meteor load files starting from the deepest node in the folder tree, in this case /Angular folder.

这篇关于Onsen-UI无法加载< ons>流星中的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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