将路由映射到显式路径不起作用 [英] Mapping route to a explicit path does not work

查看:144
本文介绍了将路由映射到显式路径不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照此处所述定义资源:

I am defining a resource as explained here:

App.Router.map(function () {
    this.resource('phones', { path: '/nodes/extensions/phones' }, function () {
        this.route('new');
    });

但是这不起作用,找到手机执行请求到 /手机而不是使用配置的值 / nodes / extensions / phones 。我做错了什么?

But this is not working. Finding the phones performs a request to /phones instead of using the configured value /nodes/extensions/phones. What am I doing wrong?

推荐答案

路径这里是浏览器地址栏中使用的路径,例如用户可以访问 http://yoursite.com/#/nodes/extensions/phones 在网站上看到这个页面。

The path here is the path used in the browser address bar, e.g. a user would access "http://yoursite.com/#/nodes/extensions/phones" to see this page on your site.

如果您要配置Ember应用程序访问的端点来检索json,例如 http://yoursite.com/api/nodes/extensions/phones 然后需要在您的Ember数据适配器或模型的数据检索功能中配置。

If instead you want to configure the endpoint that the Ember app accesses to retrieve the json, e.g. "http://yoursite.com/api/nodes/extensions/phones" then that needs to be configured in your ember-data adapter or in your model's data retrieval functions.

这篇关于将路由映射到显式路径不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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