salix/front/core/components/chip/index.js

24 lines
545 B
JavaScript

import ngModule from '../../module';
import Component from '../../lib/component';
import './style.scss';
export default class Chip extends Component {
onRemove($event) {
if (!this.disabled) this.emit('remove', {$event});
}
}
Chip.$inject = ['$element', '$scope', '$transclude'];
ngModule.vnComponent('vnChip', {
template: require('./index.html'),
transclude: {
prepend: '?prepend',
append: '?append'
},
controller: Chip,
bindings: {
disabled: '<?',
removable: '<?'
}
});