我正在创建一个离子/角度应用程序,我想使用*ngFor在语句中显示列表中的值。但是由于某些原因,*ngFor什么也不做。
*ngFor不会在我说*ngFor="let i of eventList"时运行,但会在我将变量的值放入其中时运行
*ngFor="let i of {'id': 1, 'name':'Superman'},{'id' :2,'name':'Batman'},
{'id' : 5, 'name':'BatGir
我正在尝试创建一个自定义对话框服务。为此,我创建了一个对话框服务:
import {DialogService,DialogRef,DialogCloseResult } from '@progress/kendo-angular-dialog';
import {Injectable} from "@angular/core";
import {CustomComponent} from './custom.component';
@Injectable()
export class DialogoService {
c
我的任务是为我们团队正在开发的应用程序的组件编写Karma/Jasmine测试。我不是写实际组件的人,我遇到了一个错误,到目前为止我还没有找到答案。
这是deleteuser.component.ts代码:
import {MatTableDataSource} from '@angular/material/table';
import {MatSort} from '@angular/material/sort';
import {MatPaginator} from '@angular/material/paginator';
import
这里是我的第一个组件
由第一组件发送的第二组件中的requirement:display数据。
当前状态:我将数据设置为服务获取方法,并获取数据数据,但无法显示由第一个组件模板设置的相同数据。
import { Component } from '@angular/core';
import { ConfigService } from './myservicedata';
import { Router } from '@angular/router';// add file for navigate from one page to anot
当我尝试在我的AngularJS (1.6.10版)应用程序上执行gulp serve时,收到以下错误消息:
Error: [$injector:modulerr] Failed to instantiate module myAppName due to:
$compileProvider.preAssignBindingsEnabled is not a function
@http://localhost:9805/app/scripts/app.js:43:9
invoke@http://localhost:9805/lib/angular/angular.js:5108:16
run
我正在尝试从构造函数参数中设置一个默认值,并尝试在html中进行打印。但是得到错误就像
No suitable injection token for parameter 'name' of class 'AppComponent'.
Consider adding a type to the parameter or use the @Inject decorator to specify an injection token.
无法理解。有人来帮我。我的代码:
import { Component, VERSION } from '@angular/
我试着制作一个带有棱角的网页,用组件制作一个标题。为了生成文件,我使用了ng g c commons/header来生成html、scss、ts和.spec.ts文件,并像下面这样修改app.module.ts文件:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppRouting
这是我的组件文件。我正在尝试使用ng引导模式创建一个可重用的模态组件。当我试图从共享模块导入以下组件时,我会得到一个静态注入器错误。我看过许多其他资源,但不知道我的实施有什么问题。
import {Component} from '@angular/core';
import {NgbModal, ModalDismissReasons} from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'ngbd-modal-basic',
te