在ember 2.0中获取currentPath [英] getting currentPath in ember 2.0

查看:67
本文介绍了在ember 2.0中获取currentPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Ember 2.0中,控制器将被弃用。如何访问currentPath。目前,我正在执行以下操作。

In Ember 2.0 controller will be deprecated. How do I access the currentPath. At the moment I am doing the following.

  needs: ["application"],

  routeName : function() {
    return this.get('controllers.application.currentPath');
  }.property('controllers.application.currentPath),


推荐答案

您可以执行以下操作

applicationController: Ember.inject.controller("application"),
routeName : function() {
    return this.get('applicationController.currentPath');
}.property('applicationController.currentPath)

这篇关于在ember 2.0中获取currentPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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