Guest User

Untitled

a guest
Jun 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import Ember from 'ember';
  2.  
  3. export default Ember.Controller.extend({
  4. appName: 'Ember Twiddle',
  5.  
  6. company: {
  7. cnpj: '64.184.287/0001-30'
  8. },
  9.  
  10. templates: ['64.184.287/0001-30petition-bv2', '64.184.287/0001-30petition-bv3', 'another-value', 'another-petition'],
  11.  
  12. companyTemplates: Ember.computed('company.cnpj', 'templates.[]', function(){
  13. return this.get('templates').filter(t => {
  14. return t.startsWith(this.get('company.cnpj'))
  15. }).map(t => t.replace(this.get('company.cnpj'), ''));
  16. }),
  17. });
Add Comment
Please, Sign In to add comment