Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Ember from 'ember';
- import { task, timeout } from 'ember-concurrency';
- export default Ember.Controller.extend({
- appName: 'Ember Twiddle',
- queryParams: ['search', 'statuses'],
- search: '',
- statuses: [],
- searchTask: task(function* (val) {
- yield(timeout(250));
- this.set('search', val);
- }).restartable(),
- toggleStatus (status) {
- const selectedStatuses = this.get('statuses');
- if (selectedStatuses.includes(status)) {
- selectedStatuses.removeObject(status);
- } else {
- selectedStatuses.pushObject(status);
- }
- },
- });
Add Comment
Please, Sign In to add comment