问题标签 [iron]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
968 浏览

rust - 静态可变数据的惯用替代方法是什么?

我正在使用 Iron 框架来创建一个简单的端点。我有端点需要访问的有状态的、可变的数据。

这是一些显示我意图的代码:

此代码无法编译:

我希望有更好的方法来做到这一点,不涉及任何不安全的代码或static mut. 我的问题是,实现这一目标的惯用方法是什么?

0 投票
0 回答
381 浏览

list - 带有火力收集/文件的聚合物铁清单

有没有办法将聚合物火力收集与铁名单结合起来?

我可以使用 firebase-collection 显示我的数据,但我也想使用 iron-list 来设置我的元素的样式......

0 投票
1 回答
282 浏览

rust - Iron Handler:缺少终身说明符

我正在尝试实现一个 Iron 处理程序,其中包含对另一个结构的引用。该结构保存数据并对数据执行所有操作。

这是代码:

不幸的是,我收到有关缺少生命周期说明符的错误:

但是当我添加生命周期说明符时(我还没有完全理解)......

...我收到另一条错误消息:

将有其他处理程序以只读或读写模式访问 MyServer。

添加生命周期说明符的正确方法是什么?还是我可能需要像 Arc 这样的结构?

0 投票
2 回答
276 浏览

meteor - 如何删除 Iron Router 历史记录

我正在为流星使用 Iron 路由器,并想创建 android 移动应用程序。我创建了看起来像 WhatsApp 应用程序的登录页面。用户成功登录后,我想确保当用户单击返回按钮时,用户将永远不会返回该页面。登录后的主页是用户继续单击返回按钮时将查看的最后一页。因此,如果用户在主页单击两次返回按钮,应用程序将关闭。

我希望有人能理解我的问题。

我的问题是,用户注册后的第一次,两次后退点击后杀死应用程序的android功能不会发生。或者我可以复制两次后退按钮功能,所以如果我在我的主页(登录后),我单击按钮两次,应用程序将关闭?

0 投票
1 回答
87 浏览

ios - Meteor GoogleMaps.load() not working on iOS with Iron

I'm trying to load a simple map with a marker on a page with Meteor. I'm using the GoogleMaps package and Iron.

The map is showing up correctly in my browser but when I try it out with iOS Simulator (iPhone 6 / iOS 8.3) it just never loads : it's auto-running, returning systematically false on GoogleMaps.loaded() ...

On the other side, Geolocation is correctly returning a position.

Here's a repository I setup to see the whole problem : https://github.com/Loschcode/meteor-iron-google-maps-issue

The important lines might be the GoogleMaps package setup :

And the process :

I'm not sure it's a human mistake or an issue, but it's been hours i'm on it and i really don't get it

NOTE : In my test repo I let the some alert() to fire on iOS to see the problem clearly.

Any idea on the problem ? Sorry for the CoffeeScript and the Iron structure.

0 投票
0 回答
86 浏览

rust - Read::read_to_end 在读取 markdown 时忽略空格

我的功能如下:

该文件是一个带有四段 lorem ipsum 文本的 markdown 文件。此函数在被车把记录生成器调用时,会打印到网页上,生成一堵文字墙。我显然错过了一些东西;如何让 Rust 编译器识别空格?

0 投票
1 回答
391 浏览

polymer-1.0 - 无法使用 Polymer Iron-form 示例读取 null 的属性“addEventListener”

我在这里使用 Polymer 基于 iron-form 模板创建一个表单:https ://github.com/PolymerElements/iron-form/blob/master/demo/index.html使用 formGet 表单。我的代码是:

当我点击提交时,我收到错误:无法读取 null 的属性“addEventListener”

0 投票
0 回答
115 浏览

meteor - LoadingTemplate 超时功能 - Iron & Meteor

我想知道如何在加载我的默认模板/控制器(App Controller)之前强制加载模板具有最小加载时间(例如:3 秒)。我没有订阅,所以我唯一需要的是设置延迟加载模板的超时时间。

我已经尝试过发布 [here][1] 的类似解决方案,但现在的问题是 Router.route('/', { name: 'home'}); 永远不会被调用,我被困在 loadingTemplate 页面上。

我将我的应用程序部署到http://ns-timeout.meteor.com/以便任何人都可以查看我的 console.logs()...

任何帮助将不胜感激。

非常感谢

0 投票
2 回答
152 浏览

javascript - 将超时设置为 layoutTemplate 流星/铁

我一直在努力为我的 loadingTemplate 设置 3 秒超时。

使用下面的代码 loadingTemplate 被渲染,但它确实在经过 3 秒后重定向到 layoutTemplate,正如我所料。

请在下面找到我的代码和评论问题。

我也将此版本部署到http://ns1-timeout.meteor.com/

我很感激任何帮助。

0 投票
1 回答
107 浏览

testing - 当 HTTP 服务器在旧服务器关闭后启动时测试恐慌

我编写了一些测试,每个函数都启动iron的 HTTP 服务器并在测试完成后关闭它:

cargo test我正在做:

在第二次测试开始时,该端口似乎仍在使用中。