Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template helper proposal #25

Closed
bobisjan opened this issue Oct 5, 2018 · 1 comment
Closed

Template helper proposal #25

bobisjan opened this issue Oct 5, 2018 · 1 comment
Labels

Comments

@bobisjan
Copy link
Contributor

bobisjan commented Oct 5, 2018

Hi 馃憢,

based on the upcoming addition of media helper into ember-responsive add-on https://github.com/freshbooks/ember-responsive#getting-started, I propose adding similar helper here like this

{{#if (user-agent "browser.isChrome")}}
  Chrome, here...
{{/if}}

What do you think? I'm happy to send a pull request.

@willviles
Copy link
Owner

@bobisjan - it'd definitely be good to have quick access to all the service props via a template helper.

The only change to your proposal is that we'll need to prepend each property type to the getter argument. For example:

{{#if (user-agent 'browser.isChrome')}}
{{#if (user-agent 'os.isAndroid')}}

More than happy to merge in a PR from you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants