我最近开始使用AngularCLI.我已将所有文件从Angular2转移到AngularCLI项目.
但它没有加载一些本地的CSS文件,但它正在加载其他的CSS文件?
目前的目录是:
-src
--index
--styles.css
--app
---angular2-fullcalendar
----fullcalendar.min.css
Run Code Online (Sandbox Code Playgroud)
的index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cudyangularcli</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" type="text/css" href="../src/app/angular2-fullcalendar/fullcalendar.min.css" >
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我已经查看了堆栈上的某些资源而不是流量,但有些资源没有答案,也没有处于非活动状态.
当有些人到达我的网站时,我会想要自动播放推特视频.
我能够做Youtube,所以相信这也应该可行吗?
我正在尝试测试我的组件,该组件具有已注入名为AzureService的服务的构造函数
这是组件片段:
constructor(private azureService: AzureService) { }
Run Code Online (Sandbox Code Playgroud)
这是spec文件:
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
DashbaordComponent,
StatusComponent
],
providers:[ AzureService]
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(DashbaordComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
Run Code Online (Sandbox Code Playgroud)
这是服务:
export declare var WindowsAzure;
@Injectable()
export class AzureService {
constructor() { this.client = new WindowsAzure.MobileServiceClient(this.azureUrl); }
}
Run Code Online (Sandbox Code Playgroud)
我无法理解为什么在index.html文件中导入的Azure-Apps-Client库并不重要:
<script src="//zumo.blob.core.windows.net/sdk/azure-mobile-apps-client.2.0.0.js"></script>
Run Code Online (Sandbox Code Playgroud)
有没有办法在我运行测试之前加载这个库?
有没有导致这个?
更新:这是组件代码:
getModules() {
this.result.updateInfo("Getting classes...")
this.azureService.getProgrammesByWrapper().then(((res) => {
this.result.updateInfo("Sorting classes...")
this.displayModules(res);
this.result.updateSuccess(true);
}));
}
Run Code Online (Sandbox Code Playgroud) 我不确定是否可行。
<span class="nav-label second-level-text" style="margin-left: 10px;">
{{partner.name}}
<span class="badge"
*ngIf="unreadConversations.length > 0 | unreadConversationForPartner : [unreadConversations,partner.id]">
{{unreadConversations.length | unreadConversationForPartner : [unreadConversations,partner.id]}}
</span>
</span>
Run Code Online (Sandbox Code Playgroud)
我在这边。我正在将过滤器应用于,*ngIf
并且还显示了返回的过滤器的值(即计数)
如果从管道返回的计数大于0,则我想显示一种样式,否则不显示样式。但是,我能够通过以下方式实现此目的,*ngIf and Filter
但是如果Filter
更改了的值,则*ngIf
不会更改。
例如。我在阵列中有2个项目。
项目1:长度为1,它显示跨度并执行其工作...
第2项:开始时长度为0,并且不显示(这是正确的行为),但是过滤器值发生了变化,但是之后*ngIf
不再调用。
unreadConversationForPartner pipe
transform(value: any, ...args: any[]): any {
var count = 0;
var partnerId = args[0][1];
var conversations = args[0][0];
conversations.forEach(element => {
if(element.partnerId == partnerId) count++
});
return count;
}
Run Code Online (Sandbox Code Playgroud)
让我知道所提供的信息是否不够或不清楚。