Angular 6, интерфейс не отображается - PullRequest
0 голосов
/ 30 мая 2018

Я использую MVC с Angular 6. Мой угловой код скомпилирован без ошибок на консоли, но HTML-интерфейс не отображается.Экран полон текста «Загрузка ...» из Index.html HTML-компонент Angulat не отображается.

, если я прокомментирую «машинопись»: «./node_modules/typescript/lib/typescript.js', из System.config.js,

Я получаю

  `Failed to load resource: the server responded with a status of 404 (Not 
   Found)
 localhost/:46 Error: Fetch error: 404 Not Found
 Instantiating http://localhost:26137/typescript
 Loading typescript
 Unable to load transpiler to transpile 
 http://localhost:26137/node_modules/rxjs/rx.js
 Instantiating http://localhost:26137/node_modules/rxjs/rx.js
Loading 
 http://localhost:26137/node_modules/@angular/core/bundles/core.umd.js
 Loading app
   at system.src.js:1454
  at ZoneDelegate.invoke (zone.js:388)
  at Zone.run (zone.js:138)
  at zone.js:872
  at ZoneDelegate.invokeTask (zone.js:421)
  at Zone.runTask (zone.js:188)
  at drainMicroTaskQueue (zone.js:595)
  at n (shim.min.js:8)
  `at shim.min.js:8
 at MutationObserver.t (shim.min.js:7)
(anonymous) @ localhost/:46

Мой System.config.js

  /**
 * System configuration for Angular samples
 * Adjust as necessary for your application needs.
  */
(function (global) {
System.config({
    transpiler: 'typescript',
    typescriptOptions:
        {
            emitDecoratorMetadata: true,
            experimentalDecorators: true
        },
    paths: {
        // paths serve as alias
        'npm:': './node_modules/'
    },
    // map tells the System loader where to look for things
    map: {
        // our app is within the app folder
        'app': './app',

        // angular bundles
        '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
        '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
        '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
        '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
        '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
        //'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
        '@angular/common/http': 'npm:@angular/common/bundles/common-http.umd.js',
        '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
        '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
        'tslib': 'npm:tslib/tslib.js',
        'typescript': './node_modules/typescript/lib/typescript.js',
        'rxjs': 'npm:rxjs',
        'rxjs-compat': 'npm:rxjs-compat',
        'rxjs-system-bundle': 'npm:rxjs-system-bundle',
        'rxjs-bundle': ['rxjs/*', 'rxjs/observable/*', 'rxjs/operator/*', 'rxjs/subject/*'],
        'core-js': 'npm:core-js',
        'zone.js': 'npm:zone.js',
        /*'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'*/
        'igniteui-angular': 'npm:igniteui-angular',
        'igniteui-angular-wrappers': 'npm:igniteui-angular-wrappers'
    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
        app: {
            main: 'main.js',
            defaultExtension: 'js',
            meta: {
                './*.js': {
                    loader: 'systemjs-angular-loader.js'
                }
            }
        },
        //rxjs: {
        //    defaultExtension: 'js'
        //},
        rxjs: {
            main: 'rx',
            defaultExtension: 'js',
            format: 'esm'
        },
        "rxjs/operators": {
            "main": "index.js",
            "defaultExtension": "js"
        },

        'angular2-in-memory-web-api': { defaultExtension: 'js' },
        'igniteui-angular-wrappers': {
            main: 'igniteui.angular2.js',
            defaultExtension: 'js'
        },
        'igniteui-angular': {
            main: 'main.js',
            defaultExtension: 'js'
        },           
        bundles: {
            // note: the inject:bundles comment below is used as a marker for the build script, do not remove
            // inject:bundles
        }
    }
});
})(this);

Мой Package.json:

{
  "name": "elployee-call-audit-client",
  "version": "0.0.0",
  "scripts": {
  "ng": "ng",
  "start": "ng serve",
  "build": "ng build",``
  "test": "ng test",
  "lint": "ng lint",
 "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
  "@angular/animations": "^6.0.3",
  "@angular/common": "^6.0.3",
  "@angular/compiler": "^6.0.3",
  "@angular/core": "^6.0.3",
  "@angular/forms": "^6.0.3",
  "@angular/http": "^6.0.3",
  "@angular/platform-browser": "^6.0.3",
  "@angular/platform-browser-dynamic": "^6.0.3",
  "@angular/router": "^6.0.3",
  "bootstrap": "^4.1.1",
  "core-js": "^2.5.6",
  "es6-shim": "^0.35.3",
 "igniteui-angular": "6.0.0",
 "igniteui-angular-wrappers": "5.1.1",
 "rxjs": "6.2.0",
 "rxjs-compat": "6.2.0",
 "rxjs-system-bundle": "^6.0.0",
 "systemjs": "0.21.3",
 "zone.js": "^0.8.26"
  },
  "devDependencies": {
  "@angular/compiler-cli": "^6.0.3",
  "@angular-devkit/build-angular": "~0.6.3",
  "typescript": "~2.8.3",
  "@angular/cli": "~6.0.3",
  "@angular/language-service": "^6.0.3",
  "@types/jasmine": "~2.8.7",
  "@types/jasminewd2": "~2.0.3",
  "@types/node": "~10.1.2",
 "codelyzer": "~4.3.0",
 "jasmine-core": "~3.1.0",
 "jasmine-spec-reporter": "~4.2.1",
 "karma": "~2.0.2",
 "karma-chrome-launcher": "~2.2.0",
 "karma-coverage-istanbul-reporter": "~2.0.1",
 "karma-jasmine": "~1.1.2",
 "karma-jasmine-html-reporter": "^1.1.0",
 "protractor": "~5.3.2",
 "ts-node": "~6.0.5",
 "tslint": "~5.10.0"
}
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...