https://stackblitz.com/edit/angular6-fdwnew?file=app/app.component.ts
add(item){
console.log("item--->", item);
this.tags.push(item);
this.value=''
}
delete(item) {
console.log(item);
this.tags = this.tags.filter(x => x !== item)
//this.tags.push(item);
}
答案 0 :(得分:0)
您可以使用ngModel更改HTML,这是Angular中的两种绑定方式,我认为您最好保留Input条目和标签列表的独立框
// FROM GOOGLE (https://developers.google.com/identity/sign-in/web/sign-in#sign_out_a_user)
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () { // THIS FAILED BECAUSE getAuthInstance() HADN'T COMPLETED
console.log('User signed out.');
});
}