我想问一下如何在像C#这样的javascript中实现虚函数
通过下面的这个例子,我希望得到一个'B'警报,而不是'A'.
function A() {
this.virtualFunction();
}
A.prototype.virtualFunction = function() {
alert('A');
};
//-------------------------------------
function B() {}
B.prototype = new A();
B.prototype.virtualFunction = function() {
alert('B');
};
var b = new B();
Run Code Online (Sandbox Code Playgroud)
如果我们在instanced之后调用函数,就像这样,那么它没关系,但我需要"在构造函数内部"
var b = new B();
b.virtualFunction();
Run Code Online (Sandbox Code Playgroud)
当我使用双向绑定[(ngModel)]时,我收到此消息
Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'input'.
Run Code Online (Sandbox Code Playgroud)
我知道导入FormsModule是为了解决这个问题,因为很多人都来到这里.但是,我确实导入了FormsModule,但它没有帮助,问题仍然存在
当然,我的代码还有其他问题.你能脱光吗?这是我的app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';
import { ValidationModule } from './validation/validation.module';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app.module.routing';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
ValidationModule,
AppRoutingModule,
], …
Run Code Online (Sandbox Code Playgroud)我从asp.net核心2.0开始用VS 2017创建了一个新项目.将它发布到windows azure.我收到错误IIS 502.5
检查日志流,我看到了这一点
未处理的异常:System.FormatException:交换机映射中未定义短开关'-argFile'.在Microsoft.AspNetCore.Hosting的Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()上的Microsoft.Extensions.Configuration.Command.Conmand.Configuration.CommandLine.CommandLineConfigurationProvider.Load()中的Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1提供程序).位于RecruitmentStore.Host.Program.BuildWebHost(String [] args)的Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()中的WebHostBuilder.BuildCommonServices(AggregateException和hostingStartupErrors)位于D:\ RecruitmentStore\RecruitmentStore.Host\Program.cs:第20行at at RecruitmentStore.Host.Program.Main(String [] args)在D:\ RecruitmentStore\RecruitmentStore.Host\Program.cs:第17行
IIS详细错误 - 502.5 - 错误的网关
这是我的web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore requestTimeout="00:20:00"
processPath="bin\IISSupport\VSIISExeLauncher.exe"
arguments="-argFile IISExeLauncherArgs.txt"
forwardWindowsAuthToken="false"
stdoutLogEnabled="true"
stdoutLogFile="\\?\%home%\LogFiles\stdout"/>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我看到bin文件夹(在我的本地)内生成的文件IISExeLauncherArgs.txt,但不知道它在Azure中是如何工作的.
你能告诉我如何解决这个问题吗?我确实多次重启了应用服务,这没有用
您能否告知我们是否需要保护 cookie.ASPXANONYMOUS?
谢谢你。
angular ×1
asp.net ×1
asp.net-core ×1
azure ×1
c# ×1
cookies ×1
decimal ×1
javascript ×1
oop ×1
security ×1