Last active
March 9, 2016 02:26
-
-
Save typeoneerror/2192941be3d6c346988d to your computer and use it in GitHub Desktop.
link-to-if component ala rails's link_to_if helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { | |
Component, | |
computed | |
} = Ember; | |
const LinkToIfComponent = Component.extend({ | |
condition: null, | |
routeName: computed('params.[]', function() { | |
return this.get('params')[0]; | |
}) | |
}); | |
LinkToIfComponent.reopenClass({ | |
positionalParams: 'params' | |
}) | |
export default LinkToIfComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment