这是我的代码:
<meta charset="utf-8">
<title>Rouse - Rouse launches China Software Litigation Report</title>
<meta name="robots" content="index, follow">
<meta name="title" content="Rouse launches China Software Litigation Report">
<meta property='og:title' content='Rouse launches China Software Litigation Report'/>
<meta property='og:image' content='https://sitedev.rouse.com/media/hqphzwt4/data-abstract.jpg?anchor=center&mode=crop&width=1903&height=713&rnd=132415927615200000'/>
<meta property="og:type" content="article">
<meta property='og:description' content='Report examines how foreign companies have fared in Chinese courts'/>
<meta property='og:url' content='/insights/news/2020/rouse-launches-china-software-litigation-report'/>
<meta name="article-published_time" property="article:published_time" content="2019-10-21T00:00:00-0600">
<meta name="article-modified_time" property="article:modified_time" content="2019-10-22T13:47:16-0600">
<meta name="publish_date" property="og:publish_date" content="2019-10-21T00:00:00-0600">
<meta name="author" content="Chris Bailey, Doug Clark, Nandi (Landy) Jiang"/>
<meta name="generator" content="Chris Bailey, Doug …
Run Code Online (Sandbox Code Playgroud) 我想要部署我的 Angular 项目,但它丢失了组件
步骤1:
我执行cmd:
ng-build --prod
Run Code Online (Sandbox Code Playgroud)
第2步:
我在 IIS 中添加网站,路径位于dist内
步骤3:
索引页面工作正常但未找到其他组件登录 404
http://localhost/login HTTP 错误 404.0 - 未找到
在文件App.Module.Ts中我配置路由
const routesConfig:Routes=
[
{path:"kinds",component:KindsComponent},
{path:"",component:FilmsComponent},
{path:"films",component:FilmsComponent},
{path:"login",component:LoginComponent},
{path:"accounts",component:AccountsComponent},
{path:"customers",component:CustomersComponent},
{path:"director",component:DirectorComponent}
];
Run Code Online (Sandbox Code Playgroud)
再次注意: http://localhost工作正常,但当我构建项目并在 IIS 中部署时找不到其他组件
怎样才能发挥作用呢?我的错误在哪里?
我在谷歌搜索了解决方案,但没有找到。
尝试 1:
<input type="text" #txtSearch (keyup)="onKeyUp(txtSearch.value)">
Run Code Online (Sandbox Code Playgroud)
和 search.component.ts
onKeyUp(val){
setTimeout(function(){
console.log(val);
},500);
}
Run Code Online (Sandbox Code Playgroud)
试过 2
我在这里使用类似的如何在 angular2 中使用 rxjs 实现输入 keyup 事件的去抖动服务,但在 Angular 7 中不起作用。
最后
我希望 keyup 延迟 0.5s 然后 console.log(value);
我正在使用Angular7。我想在打字稿中获取并设置变量
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class LoginService {
public username:string;
public token:string;
public fullname:string;
constructor() { }
set setUser(val: string){
this.username = val;
}
set setToken(val:string){
this.token=val;
}
set setFullName(val:string){
this.fullname=val;
}
get getUser():string{
return this.username;
}
get getToken():string{
return this.token;
}
get getFullName():string{
return this.fullname;
}
}
Run Code Online (Sandbox Code Playgroud)
fLogin(user, pass) {
this.users.setUser=user;
}
Run Code Online (Sandbox Code Playgroud)
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { Http, Headers } from "@angular/http";
import …
Run Code Online (Sandbox Code Playgroud)