简体   繁体   English

Angular 样板文件未读取 abp

[英]Angular Boilerplate not reading abp

hello hile working on boilerplate project im now learning to consume services from the backend (asp .net) on angular via http requests, so i was trying to add delete method on mycomponent.ts but my typescript won't read abp variable and i cant import the animations: [appModuleAnimation()] are they related?你好,我在样板项目上工作,我现在正在学习通过 http 请求在 angular 上使用后端 (asp .net) 的服务,所以我试图在mycomponent.ts上添加删除方法,但我的 typescript 不会读取 abp 变量,我不能导入动画:[appModuleAnimation()]它们是否相关? for no reason here is my component code:无缘无故这是我的组件代码:

import { PagedListingComponentBase, PagedRequestDto } from './../../../../../../shared/paged-listing-component-base';
import { FamilleImmobilisationDto } from './../../../dtos/famille-immobilisation';
import { Component, Injector } from '@angular/core';
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
import { finalize } from 'rxjs/operators';
import { FamilleimmobilisationService } from '../../../services/familleimmobilisation.service';

class PagedFamilleImmobilisiationRequestDto extends PagedRequestDto {
  keyword: string;
}

@Component({
  selector: 'app-familleimmobilisation',
  templateUrl: './familleimmobilisation.component.html',
  animations: [appModuleAnimation()],
  styleUrls: ['./familleimmobilisation.component.css']
})
export class FamilleimmobilisationComponent extends PagedListingComponentBase<FamilleImmobilisationDto> {
  familleImmobilisations: FamilleImmobilisationDto[] = [];
  keyword = '';
  advancedFiltersVisible = false;

  constructor(
    injector: Injector,
    private _familleImmobilisationService: FamilleimmobilisationService,
    private _modalService: BsModalService
  )
  {
    super(injector);
  }

  createFamilleImmobilisation(): void {
    this.showCreateOrEditFamilleImmobilisationDialog();
  }
  editFamilleImmobilisation(familleimob: FamilleImmobilisationDto): void {
    this.showCreateOrEditFamilleImmobilisationDialog(familleimob.id);
  }

  clearFilters(): void {
    this.keyword = '';
    this.getDataPage(1);
  }

  protected list(
    request: PagedFamilleImmobilisiationRequestDto,
    pageNumber: number,
    finishedCallback: Function
  ): void {
    request.keyword = this.keyword;
    console.log(request.keyword);
    this._familleImmobilisationService
      .getAll()
      .pipe(
        finalize(() => {
          finishedCallback();
        })
      )
      .subscribe(data => {
        this.familleImmobilisations = data.result;
        console.log(this.familleImmobilisations)
        this.showPaging(data, pageNumber);
      });
  }


  protected delete(familleimob: FamilleImmobilisationDto): void {
     
    abp.message.confirm(
      this.l('familleimobDeleteWarningMessage', familleimob.code),
      undefined,
      (result: boolean) => {
        if (result) {
          this._familleImmobilisationService.delete(familleimob.id).subscribe(() => {
            abp.notify.success(this.l('SuccessfullyDeleted'));
            this.refresh();
          });
        }
      }
    );
  }

  private showCreateOrEditFamilleImmobilisationDialog(id?: string): void {
    let createOrEditFamilleImmobilisationDialog: BsModalRef;
    if (!id) {/*
      createOrEditFamilleImmobilisationDialog = this._modalService.show(
        CreateBanqueDialogComponent,
        {
          class: 'modal-lg',
        }
      );*/
    } else {/*
      createOrEditFamilleImmobilisationDialog = this._modalService.show(
        EditBanqueDialogComponent,
        {
          class: 'modal-lg',
          initialState: {
            id: id,
          },
        }
      );*/
    }

    /*createOrEditBanqueDialog.content.onSave.subscribe(() => {
      this.refresh();
    });*/
  }





}

here is some screenshots for more details:这是一些屏幕截图以获取更多详细信息: 应用模块动画导入

no import suggestion here:这里没有导入建议: 缺少应用程序模块动画导入

not reading abp variable:不读取 abp 变量: 可以找到名称bp

It's Solved actually it was my bad,i forgot to call my modul on the app-routing module so after adding that call,the import of [appModuleAnimation()] so it fixed the abp Warning also.:它已经解决了,实际上是我的错,我忘记在应用程序路由模块上调用我的模块,所以在添加该调用之后, [appModuleAnimation()]的导入因此它也修复了 abp 警告。:

app-routing.module.ts:应用程序路由.module.ts:

{ 
                        path: 'immobilisation', loadChildren: () => import('./modules/immobilisation/immobilisation.module').then(m => m.ImmobilisationModule) 
                    },

进口显示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM