[ngx-spinner]: 属性 "type" 被遗漏了。我的微调器没有按应有的方式加载类型
[ngx-spinner]: Property "type" is missed. My spinner is not loading the type as it should
这里是我在 Chrome 的控制台中实现微调器 properties.And 的地方我收到此错误:[ngx-spinner]:属性“类型”丢失。请为组件提供动画类型并确保 css 添加到 angular.json 文件
export class BusyService {
busyRequestCount = 0;
constructor(private spinnerService: NgxSpinnerService) { }
busy(){
this.busyRequestCount++;
this.spinnerService.show(undefined, {
type: 'pacman',
bdColor: 'rgba(255,255,255,0)',
color: '#333333'
})
}
idle(){
this.busyRequestCount--;
if(this.busyRequestCount <= 0){
this.busyRequestCount = 0;
this.spinnerService.hide();
}
}
这里是 angular.json
"styles": [
"./node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"./node_modules/font-awesome/css/font-awesome.css",
"./node_modules/bootswatch/dist/united/bootstrap.css",
"./node_modules/ngx-toastr/toastr.css",
"./node_modules/ngx-spinner/spinner.css",
"src/styles.css"
],
在 angular.json 文件中,您必须像这样添加(在代码下方)& 请查看 node_modules>ngx-spinner>您要添加的加载类型的动画你的指标
"styles": [
"./node_modules/ngx-spinner/animations/line-scale-party.css"
],
将“类型”属性 添加到使用它的模板中的 ngx-spinner 组件,如下所示:
<ngx-spinner type="pacman">
<p>Loading...</p>
</ngx-spinner>
这里是我在 Chrome 的控制台中实现微调器 properties.And 的地方我收到此错误:[ngx-spinner]:属性“类型”丢失。请为组件提供动画类型并确保 css 添加到 angular.json 文件
export class BusyService {
busyRequestCount = 0;
constructor(private spinnerService: NgxSpinnerService) { }
busy(){
this.busyRequestCount++;
this.spinnerService.show(undefined, {
type: 'pacman',
bdColor: 'rgba(255,255,255,0)',
color: '#333333'
})
}
idle(){
this.busyRequestCount--;
if(this.busyRequestCount <= 0){
this.busyRequestCount = 0;
this.spinnerService.hide();
}
}
这里是 angular.json
"styles": [
"./node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"./node_modules/font-awesome/css/font-awesome.css",
"./node_modules/bootswatch/dist/united/bootstrap.css",
"./node_modules/ngx-toastr/toastr.css",
"./node_modules/ngx-spinner/spinner.css",
"src/styles.css"
],
在 angular.json 文件中,您必须像这样添加(在代码下方)& 请查看 node_modules>ngx-spinner>您要添加的加载类型的动画你的指标
"styles": [
"./node_modules/ngx-spinner/animations/line-scale-party.css"
],
将“类型”属性 添加到使用它的模板中的 ngx-spinner 组件,如下所示:
<ngx-spinner type="pacman">
<p>Loading...</p>
</ngx-spinner>