小编Bh0*_*han的帖子

Angular 6在"e2e/app"文件夹中生成服务

我最近将角度4升级到6.现在我尝试了下面的命令

ng generate service security/security
Run Code Online (Sandbox Code Playgroud)

但它在"e2e/app"文件夹下创建了服务,而不是在"src/app"下面是我的angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "xyz": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.app.json",
            "polyfills": "src/polyfills.ts",
            "assets": [
              "src/assets",
              "src/favicon.ico"
            ],
            "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "src/style.scss",
              "src/styles.css"
            ],
            "scripts": [
            ]
          },
          "configurations": {
            "production": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "fileReplacements": [ …
Run Code Online (Sandbox Code Playgroud)

angular angular6

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

我们可以在类中声明密封方法吗

class X {
    sealed protected virtual void F() {
        Console.WriteLine("X.F");
    }
    sealed void F1();
    protected virtual void F2() {
        Console.WriteLine("X.F2");
    }
}
Run Code Online (Sandbox Code Playgroud)

在上面的代码中有编译时错误:

XF()'不能密封,因为它不是替代

X.F1()'无法密封,因为它不是替代

这是否意味着我们只能使用sealed必须覆盖某些方法的关键字whey?

c# oop overriding sealed

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

标签 统计

angular ×1

angular6 ×1

c# ×1

oop ×1

overriding ×1

sealed ×1