无法使用ionic和form-geted指令代理错误



我刚开始一个新项目,当我试图构建一个表单时,我得到了这个错误

找不到模块:错误:无法解析'@ion/angular/directives/proxys'

我的html

<form>
<ion-card>
<ion-list>
<ion-item>
<ion-label>Categoria:</ion-label>
<ion-select #categoryId name="categoryId" cancelText="Cancelar">
<ion-select-option *ngFor="let cat of categoryList" [value]="cat.id">{{cat.name}}</ion-select-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label>Relacionado:</ion-label>
<ion-select #tagsId name="tagsId" cancelText="Cancelar">
<ion-select-option *ngFor="let tag of tagsList " [value]="tag.id">{{tag.name}}</ion-select-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label color="primary" position="floating">Titulo:</ion-label>
<ion-input #title oninput="this.value = this.value.toUpperCase()" name="title" type="text></ion-input>
</ion-item>
<ion-item>
<ion-label color="primary" position="floating">Publicação:</ion-label>
<ion-textarea #content name="content" ></ion-textarea>
</ion-item>
<ion-reorder-group disabled="true">
<ion-item lines="none" class="ion-padding" *ngFor="let photo of pictureService.photos" (click)="pictureService.askDelete(photo)">
<ion-img [src]="photo.data"></ion-img>
<!--<ion-reorder></ion-reorder>-->
</ion-item>
</ion-reorder-group>
<ion-button class="ion-padding" expand="full" color="tertiary" (click)="pictureService.selectFrom()">
<ion-icon slot="icon-only" name="camera"></ion-icon>&nbsp;&nbsp;&nbsp;Adicionar foto
</ion-button>
<br/>
<ion-button type="submit" (click)="submitPost()" class="ion-padding-start ion-padding-end" expand="full" color="secondary">Enviar</ion-button>
</ion-list>
</ion-card>

和我的ts文件

categoryList : CategoryModel[] = [];
tagsList     : TagsModel[] = [];
showSubmit   : boolean = false;
@ViewChild('title',{static:false}) title: IonInput;
@ViewChild('categoryId',{static:false}) categoryId: IonSelect;
@ViewChild('tagsId',{static:false}) tagsId: IonSelect;
@ViewChild('content',{static:false}) content: IonTextarea;
constructor(private authService     : AuthService,
private categoryService : CategoryService,
private tagsService     : TagsService,
private postsService    : PostsService,
private pictureService  : PictureService,
private funcsHelperService : FuncsHelperService,
private router          : Router) {
this.categoryList = this.categoryService.categoryStoredList;
this.tagsList     = this.tagsService.tagsStoredList;
}
ngOnInit() {
}

submitPost() {
const data: PostsModel  = {
categoryId: this.categoryId.value,
tagsId: this.tagsId.value,
date: new Date().getDate().toString(),
title: this.title.value.toString(),
content: this.content.value,
photo: this.pictureService.getImagesArray(),
uid: this.authService.currentUser.uid,
video: null
};
this.funcsHelperService.presentLoading("Enviando seu post ...");
this.postsService.add(data).then( response => {
this.funcsHelperService.dismissLoading();
console.log("addPost",response);
});
}

此外,我尝试使用formGroup而不是viewChild,我得到了同样的错误,我删除了所有的node_modules文件夹和锁定文件,然后重新安装,但没有任何更改。

我该如何解决这个问题?我以前从未犯过这个错误。

我在我的package.json中降级到ion/angular 8.1.2并开始工作。

最新更新