【发布时间】:2015-07-15 05:05:17
【问题描述】:
我正在使用 ionic 为智能手机开发一个流星应用程序。
不幸的是,显示背景颜色和后退按钮的 ionic 样板代码显示在我的一些网站上,而在一些网站上则没有。
在我看来它是随机的,但也许不是。
如何让我的所有模板都显示 ionic 主题?
下面是对项目细节的描述以及我到目前为止所尝试的内容......
这是我的包裹清单:
aldeed:collection2 2.3.1* Automatic validation of insert and update operations on the client and server.
anti:i18n 0.4.3 Internalization: simplest package
fourseven:scss 2.0.1_5* Style with attitude. Sass and SCSS support for Meteor.js (with autoprefixer and sourcem...
iron:router 1.0.9 Routing specifically designed for Meteor
mdg:reload-on-resume 1.0.4 On Cordova, only allow the app to reload when the app is resumed.
meteor-platform 1.2.2 Include a standard set of Meteor packages in your app
meteoric:autoform-ionic 0.1.5 Ionic theme for Autoform
meteoric:ionic 0.1.17 Ionic components for Meteor. No Angular!
meteoric:ionic-sass 0.1.9 Ionic's CSS Framework in SASS and bundled for Meteor.
meteoric:ionicons-sass 0.1.6 Ionic's Ionicons library in SASS and bundled for Meteor.
spacebars 1.0.6 Handlebars-like template language for Meteor
以下是我进行的测试的描述和有关该问题的屏幕截图: 对于名为“about”的模板,显示了离子主题。 我确实将模板代码复制到了一个名为 about2.html 的文件中,并将模板命名为 about2。我添加了一条名为 about2 的路线。结果是 about.html ionic 按预期工作,但 about2.html 没有。
我检查了包含的 css 文件,两个页面都相同。
由 javascript 生成的 html 代码不同。
这是我关于模板的代码:
<template name="about">
{{#contentFor "headerButtonLeft"}}
<div class="buttons">
{{>myIonBackButton path="main" }}
</div>
{{/contentFor}}
{{#contentFor "headerTitle"}}
<h1 class="title">{{i18n 'about.title'}}</h1>
{{/contentFor}}
{{#ionView}}
{{#ionContent}}
<p>
{{i18n 'about.content'}}
Hello world
{{i18n 'backButton'}}
</p>
{{/ionContent}}
{{/ionView}}
</template>
我是这样设置路线的:
Router.map(function(){
/*Main menu*/
this.route('about');
this.route('about2');
});
以下是显示我遇到的问题的屏幕截图: 关于路线
about2 路线
我也试过了:
- 在没有线索的情况下使用 meteor debug 调试应用程序 如何正确处理我的问题
- 使用 meteor reset 重置我的应用程序
- 将我的应用程序作为 android 应用程序运行
为什么我的布局没有正确显示在每个视图中?
【问题讨论】:
-
您有一个名为 about 的模板和另一个名为 about2 的模板,它们的代码完全相同,但显示的内容不同?
-
没错。 about2 在文件夹 client/templates/about2 中的 about2.html 中 about 在 client/templates/about 中的 about.html 没有修改模板的 javascript 代码,我已经编写了。我什至用不同的浏览器尝试过,以确保它没有缓存问题。
-
altergear.net/media/tmp/p131_uploaded.zip 这个 77kb 的重置流星项目重现了错误。
标签: javascript node.js meteor ionic meteoric