mardi 24 janvier 2017

Ember.js - How to pass a string as an argument in ember-can helper

I'm using ember-can add-on for setting privileges for the user. Is there anyway to pass a string as an argument in ember-can helper.currently using this below code


  <button >Write Post</button>


abilities class

canWrite: Ember.computed('user.admin', function() {
  return this.get('user.admin');
})

instead i need to pass a string value(eg:superadmin) in can helper and check whether user.admin == superadmin in abilities class. Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire