小编Mar*_*ton的帖子

core/src/render3/interfaces 中的 Angular 构建错误

在构建 Angular 6 应用程序时,我@angular/core/src/render3/interfaces在第 35 行收到编译错误。该行是:

   [ACTIVE_INDEX]: number | null;
Run Code Online (Sandbox Code Playgroud)

错误是: error TS1169: A computed property name in an interface must directly refer to a built-in symbol.

我正在使用@angular/core@6.1.6. 我做错了什么还是这是一个 Angular 错误?

visual-studio-2017 angular6

7
推荐指数
1
解决办法
1821
查看次数

Angular 4"无法绑定到'ngModel',因为它不是'input'的已知属性."

这似乎是一个流行的问题,但解决方案都建议导入FormsModule,而这正在完成.

错误是:

无法绑定到'ngModel',因为它不是'input'的已知属性.("

<label for="city">City</label>
<input type="text" id="city" [ERROR ->][(ngModel)]="chosenCity">
<input type="button" value="Get Weather" (click)="getWeather(chosenCity)" "):
Run Code Online (Sandbox Code Playgroud)

模板和组件代码如下:

import { Component } from '@angular/core';
import { Http } from '@angular/http';

@Component({
    selector: 'weather',
    templateUrl: './weather.component.html'
})
export class WeatherComponent {
    public weather: Weather;

    constructor( private http: Http) {
    }

    public getWeather(chosenCity: string): void {
        this.http.get('/api/weather/city/' + chosenCity).subscribe(result => {
            this.weather = result.json();
        });
    }
}

interface Weather {
    temp: string;
    summary: string;
    city: string;
}
Run Code Online (Sandbox Code Playgroud)
<h1>Weather check</h1>

<label for="city">City</label>
<input type="text" …
Run Code Online (Sandbox Code Playgroud)

angular

5
推荐指数
1
解决办法
2万
查看次数

InvalidOperationException:方案已经存在:Bearer

我最近恢复了一个已经休眠了一年的项目的工作。它在AspNet Core 1.1上使用了Angular,并使用了OpenIddict 1.0的早期版本。它是使用VS2017开发的。

我将VS2017更新到最新版本(15.7.5),但该项目无法编译,并且当我修复编译错误时,它将无法运行。因此,最终我忍受了决定,决定将项目更新为Asp Net Core 2.1,并使用最新版本的OpenIddict。我有项目,因此可以编译,但是在启动时会在标题中显示错误,即“ InvalidOperationException:方案已经存在:Bearer”

我看不出有什么问题。我知道在某个地方添加了另一个名为“ Bearer”的方案,但我不知道在哪里。我将其全部封闭在Startup.cs下面。

using AspNet.Security.OpenIdConnect.Primitives;
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SIAngular.DBContexts;
using SIAngular.Models;
using SIAngular.Services;
using OpenIddict.Abstractions;
using System.IdentityModel.Tokens.Jwt;
using Microsoft.IdentityModel.Tokens;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Authentication.JwtBearer;

namespace SIAngular
{
    public class Startup
    {
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                .AddEnvironmentVariables();
            Configuration = builder.Build();
        }

        public IConfiguration Configuration { get; }

        public void ConfigureServices(IServiceCollection services)
        { …
Run Code Online (Sandbox Code Playgroud)

openiddict visual-studio-2017 asp.net-core-2.0

1
推荐指数
1
解决办法
2090
查看次数