问题标签 [chaplinjs]

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 回答
534 浏览

backbone.js - How to use hash (#) on urls in chaplin.js like backbone used to do?

let's say that I have two "pages" (endpoints) on a chaplin.js site

the routes:

and two links:

the generated urls are "correct":

(notice that I'm not on the root of the site). When I start the application at "home" and then click the "Go to second" link i get correctly redirected to the second view, everything gets tendered correctly and the url on the browser changes to mysite.com/something/second_view

But then I cannot refresh the navigator since my webserver will try to reach a second_view folder instead, and I'll get a 404.

What i need is to always generate the urls using a # like in backbone, something like mysite.com/something/#/second_view.

BTW: that last link works but chaplin deletes the # (like a redirect)

Maybe I need to configure something? or change something on the ùrl`helper, I couldn't find anything in the docs. Any Ideas??

Thxs

0 投票
1 回答
437 浏览

backbone.js - Chaplin 路由器可选参数

我正在研究 ChaplinJS(骨干框架)。以下是我的 route.js 代码块。

相反,我想做以下事情

这对 Backbone 来说效果很好。我也浏览了rails的路由代码,它在那里工作。但是当谈到 chaplinjs 时,它不会!

在 chaplinJS 文档中,我没有找到与路由器可选参数相关的任何内容。

0 投票
0 回答
40 浏览

javascript - template croosdomain with requirejs returns blank page

I implementing one app html5 with chaplinjs (can see here https://github.com/andru255/chtw), the paths of the htmls runing good, but returning blank pages when release the request by firebug and showin in red like a error in request, but in other tab in the browser loads very well the path of this template, whats happen in this case? what fail in the request?

0 投票
2 回答
335 浏览

javascript - 卓别林/主干问题 - 将项目添加到集合时未触发“添加”事件

我正在为自己构建一个测试应用程序,以了解有关 coffeescript、Backbone、Brunch.io 和 Chaplin JS 的更多信息,但我被卡住了,我无法弄清楚我做错了什么。

这是我在 todo-view.coffee 中的代码:

问题是:事件监听器(在监听器对象中设置)没有被触发。所以 @renderTodoList 没有被调用。

不过,直接从 @initialize 函数调用 @renderTodoList 确实有效。但我希望该功能由集合上的“添加”事件触发。

我还尝试通过在创建新数据模型的循环中添加 @collection.trigger "add" 来手动触发事件。但这也不起作用。

任何想法我正在监督或做错了什么?

0 投票
1 回答
136 浏览

backbone.js - 将 Chaplin 与其他 Backbone 扩展混合使用

我正在研究用卓别林编写的应用程序。我们希望我们的 REST 是 HATEOAS,并且我们正在考虑在我们的 JSON 中使用HAL作为标准链接结构。我看到有一个与 HA L 一起使用的 Backbone 扩展,但这会产生它自己的ModelCollection类。卓别林也制作了自己的ModelCollection。有没有一种简单的方法来制作一个结合了 HAL 和卓别林模型和课程的“大师”Model和课程?CollectionCollection

0 投票
0 回答
144 浏览

android - Phonegap Android + Backbone(ChaplinJS)中的网络错误

在 Android 上运行我的应用程序时,index.html显示效果与预期一样。但是,当我通过链接(即movies/)遵循路线时,我得到一个Application Error - A network error has occured (file:///android_asset/www/movies/). 我尝试了不同的pushState设置,但没有运气。

该项目在浏览器中运行良好。在 Android 4.2.2 设备上使用 Cordova 2.9.7。

我的应用程序结构:

0 投票
1 回答
137 浏览

chaplinjs - 将 ECT 模板与卓别林一起使用

您好,我想将 ect 模板与卓别林 js 一起使用。我无法按照卓别林样板集成把手的方式集成 ect 模板。请帮助谢谢。

0 投票
1 回答
434 浏览

chaplinjs - 使用 ChaplinJS 的中介监听路由器事件

我目前正在为一个新项目尝试 ChaplinJS,但遇到了问题。

我想要一个控制器(用于我的导航)来监听路由器的变化。我想对 changeURL 或 route 等事件进行回调。我不确定卓别林的中介是如何工作的,但我认为路由器正在使用我应该能够捕获的中介抛出事件。我试过这个:

0 投票
1 回答
168 浏览

node.js - 带有卓别林的 Node.js:结构

将 Chaplin 与 node.js 一起使用时的文件结构如何?

我已经下载了 brunch-with-chaplin,这看起来很简单,但是我在哪里放置我的 node.js 文件?

我有 node 的 app.js 文件,但我应该把它放在哪里以及如何使用它启动我的卓别林应用程序?我不想将服务器端文件与卓别林文件混合在一起。

0 投票
2 回答
389 浏览

node.js - 开始使用卓别林和 node.js

有没有办法将卓别林与 node.js/express 一起使用?我还没有找到关于这个主题的单个教程或示例。

如果是这样,我该如何开始?文件夹结构如何?还是我的 server.js 文件?