将我的角度应用程序上传到生产环境时遇到问题。该应用程序在开发中运行良好,并且在投入生产之前也可以正常工作。
要构建我的应用程序,我正在使用:
ng build --prod --base-href="/site/"
Run Code Online (Sandbox Code Playgroud)
该应用程序已构建,但带有以下警告:
WARNING in ./src/app/eco-header/eco-header.component.ngfactory.js 138:299-319 "export 'MAT_ICON_LOCATION' (imported as 'i9') was not found in '@angular/material/icon'
WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1247-1265 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'
WARNING in ./node_modules/@angular/material/dialog/typings/index.ngfactory.js 20:1267-1285 "export 'ScrollingModule' (imported as 'i7') was not found in '@angular/cdk/scrolling'
WARNING in ./node_modules/@angular/material/icon/typings/index.ngfactory.js 20:327-347 "export 'MAT_ICON_LOCATION' (imported as 'i1') was not found in '@angular/material/icon'
Run Code Online (Sandbox Code Playgroud)
当我尝试加载页面时,出现以下错误:
Uncaught TypeError: e is not a constructor
at main.1ebe20842d3713f62535.js:1
at Wl (main.1ebe20842d3713f62535.js:1)
at main.1ebe20842d3713f62535.js:1
at new …Run Code Online (Sandbox Code Playgroud) 我最近在 Angular 6 中做了一个新项目,我之前的所有经验都是在 Angular 1.5 中。
我想根据文本值控制 HTML 页面中项目的背景颜色。
有没有办法专门使用 Angular 方法之类的方法来做到这ngStyle一点,而不仅仅是在组件中编写一个 jQuery 函数来根据值更改 CSS 类?
<span class="producerState">{{prod.producerState}}</span>
Run Code Online (Sandbox Code Playgroud)
.producerState根据文本值更改跨度的背景。
我正在使用以下指南在我的 ubuntu 16.04 机器上安装 MSSQL 服务器 https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-2017
当我跑步时:
sudo /opt/mssql/bin/mssql-conf setup
Run Code Online (Sandbox Code Playgroud)
无论我选择哪种 SQL Server 版本,都会出现以下错误:
Confirm the SQL Server system administrator password:
Configuring SQL Server...
This program has encountered a fatal error and cannot continue running at Mon Apr 1 16:06:07 2019
The following diagnostic information is available:
Reason: 0x00000007
Message: Cannot open or read the persistent registry: \SystemRoot\security.hiv.
Process: 19600 - sqlservr
Thread: 19604 (application thread 0x4)
Instance Id: 7ebfcf27-db60-460d-afd3-6d852b70069e
Crash Id: d99ba388-d323-43f3-b758-e116f42bb2e8
Build stamp: 70437f6583b8ef39b1ef70539ef84690980315dc7a4436c9c40015f28610e4aa
Distribution: Ubuntu 16.04.6 …Run Code Online (Sandbox Code Playgroud) 我在运行以下命令时遇到 ci 问题 repo init(包含清单和存储库 url):
repo init --no-clone-bundle -u <manifest url> -b <branch name> --repo-url <repo url> --no-repo-verify
存储库初始化过程正在启动,但由于终止初始化的错误而无法完成:
fatal: refs/remotes/origin/stable^0: not a valid SHA1
我在同一个存储库中运行了几个分支,但它不起作用,但问题是当我尝试不同的存储库时- 错误不会出现。所以我假设这是回购级别的错误,主要问题是这个“稳定^ 0”是什么,我正在努力解决如何正确地做到这一点。
有什么建议么?
在调用ngOnDestroy并取消订阅后,第二次尝试订阅EventEmitter时出现以下错误:
ngOnInit() {
this.route.params.subscribe(params => {
this.resources.eco_id= params['id']
});
this.http.ReloadForm.subscribe(res=>this.OnFormLoad(res));
}
ngOnDestroy(){
this.http.ReloadForm.unsubscribe();
}
Run Code Online (Sandbox Code Playgroud)
core.js:1601错误错误:EventEmitter.push ../ node_modules / rxjs / _esm5 / internal / Subject.js.Subject._trySubscribe(Subject.js:86)处的新ObjectUnsubscribedError(ObjectUnsubscribedError.js:6)上的对象已取消订阅EventEmitter.push ../ node_modules / rxjs / _esm5 / internal / Observable.js.Observable.subscribe(Observable.js:28)位于EventEmitter.push。在EcoProcedureFormComponent.push ../ src / app / forms / eco-form / eco-procedure-form.component.ts.EcoProcedureFormComponent.ngOnInit(eco-procedure-form.component.ts:57)上订阅(core.js:3743) )在对象的prodCheckAndUpdateNode(core.js:11333)的checkAndUpdateNode(core.js:11333)的checkAndUpdateNodeInline(core.js:11371)的checkAndUpdateDirectiveInline(core.js:10105)处。评估[作为updateDirectives](EcoProcedureFormComponent_Host.ngfactory.js:10)
如果没有在ngOnDestroy上取消订阅,一切正常,但是我必须以某种方式释放订阅。
我该如何解决?
谢谢
我有一个简单的对象,其中有几个我想验证的字段。我希望允许特定的验证模式或所有属性都有空值
我创建了以下两个架构:
const nonEmptyUserInfoValidationSchema = Joi.object({
url: Joi.string().uri().required(),
username: Joi.string().required().min(usernameMinLength),
password: Joi.string().required().min(passwordMinLength),
});
const emptyUserInfoValidationSchema = Joi.object({
url: Joi.string().empty().required(),
username: Joi.string().empty().required(),
password: Joi.string().empty().required(),
});
Run Code Online (Sandbox Code Playgroud)
我希望创建验证是否应用emptyUserInfoValidationSchema或 的架构nonEmptyUserInfoValidationSchema,但我不知道该怎么做,有什么建议吗?
允许:
{url:"http://some.url", username:"some username", password:"some password"}
{url:"", username:"", password:""}
Run Code Online (Sandbox Code Playgroud)
不允许:
{url:"http://some.url", username:"", password:""}
Run Code Online (Sandbox Code Playgroud) 我正在寻找一种公式/方法来衡量一条指令的速度,或者更具体地说是通过CPU周期给出每条指令的"得分".
我们以下面的汇编程序为例,
nop
mov eax,dword ptr [rbp+34h]
inc eax
mov dword ptr [rbp+34h],eax
Run Code Online (Sandbox Code Playgroud)
以及英特尔Skylake的以下信息:
mov r,m:吞吐量= 0.5延迟= 2
mov m,r:吞吐量= 1延迟= 2
nop:吞吐量= 0.25延迟=非
inc:吞吐量= 0.25延迟= 1
我知道程序中指令的顺序在这里很重要,但我希望创建一些通用的东西,不需要"对单循环准确"
任何人都知道我该怎么做?
非常感谢
angular ×3
typescript ×2
angular-cli ×1
assembly ×1
bash ×1
bitbucket ×1
css ×1
eventemitter ×1
git ×1
git-bash ×1
javascript ×1
joi ×1
jquery ×1
performance ×1
sql-server ×1
subscribe ×1
ubuntu-16.04 ×1
x86 ×1
x86-64 ×1