Extending link-to

强颜欢笑 提交于 2019-12-13 00:42:40

问题


I'm trying to create a custom link-to helper that will conditionally add query-params depending on the presence of a property. Right now, I'm getting an error: Uncaught TypeError: Cannot read property 'options' of undefined. I've traced that to the line var options = parameters.options in the function resolvedParams.

Here's my code:

In app/components/foo-link.js:

export default Ember.LinkView.extend({
  init: function() {
    this._super();
  }
});

In the template:

{{foo-link title='Bar' hrefBinding='bar'}}

What am I doing incorrectly? Is this even the correct approach? I've already extended SelectView's like this, so I'm not sure why this is so difficult.

I'm using Ember CLI version 0.1.5.

来源:https://stackoverflow.com/questions/28160805/extending-link-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!