Я установил его, используя npm, следуя инструкциям github readme, но я не могу загрузить пакет и запустить функционал.
Это один из моих классов, использующих пакет.
import { JsonObject, JsonProperty } from 'json2typescript';
@JsonObject('AssignmentOrganizationalUnitReference')
export class AssignmentOrganizationalUnitReference extends ReferenceBase {
@JsonProperty('OrganizationName', String)
OrganizationName: string = undefined;
@JsonProperty('Name', String)
Name: string = undefined;
@JsonProperty('Active', Boolean)
Active: Boolean = undefined;
@JsonProperty('IncludeSubUnits', Boolean)
IncludeSubUnits: Boolean = undefined;
@JsonProperty('AssignmentRoles', [AssignmentRole])
AssignmentRoles: AssignmentRole[] = undefined;
@JsonProperty('UnitId', String)
UnitId: string = undefined;
@JsonProperty('Type', OrganizationalUnitReferenceType)
Type: OrganizationalUnitReferenceType = undefined;
}
Это моя systemjs
(function (global) {
System.config({
defaultJSExtensions: 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/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@angular/common/http': 'npm:@angular/common/bundles/common-http.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
'tslib': 'npm:tslib/tslib.js',
'ngx-infinite-scroll': 'npm:ngx-infinite-scroll/bundles/ngx-infinite-scroll.umd.js',
'ngx-spinner': 'npm:ngx-spinner/ngx-spinner.umd.js',
'jquery': 'Content/platform/scripts/extensions/jquery-1.7.2.js',
'json2typescript': 'npm:json2typescript/index.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: 'app/main.js',
defaultExtension: 'js',
meta: {
'./*.js': {
loader: 'systemjs-angular-loader.js'
}
}
},
rxjs: {
defaultExtension: 'js'
}
}
});
})(this);
Я получаю сообщение об ошибке при загрузке страницы. Он ищет файлы, представляющие то, что я импортирую, но не могу их найти. Это дает мне 404 с ..
![enter image description here](https://i.stack.imgur.com/yr6n2.png)