I am trying to use ng2-tag-input module , with a very basic configuration:
import { Component } from '@angular/core';
@Component({
moduleId: module.id,
selector: 'search-form',
template: `<tag-input [(ngModel)]='items'></tag-input>`
})
export class SearchFormComponent {
items = ['Pizza', 'Pasta', 'Parmesan'];
options = {
placeholder: "+ term",
secondaryPlaceholder: "Enter a new term",
separatorKeys: [32,13]
}
onItemAdded(item) {
}
onItemRemoved(item) {
}
}
Everything works, except separatorKeys - it has no effect, when I type space key (keyCode=32)
, it behaves as a normal space instead of a separator.
On the demo page their example works fine, is this something that can be related to NG2 version?
I am the author of the module.
It does not seem you are setting the separatorKeys attribute in your template. Have a look at http://www.webpackbin.com/NJy38G8kM for the source code.