综合技术

Importing Automapper into a web storage project angular2

微信扫一扫,分享到朋友圈

Importing Automapper into a web storage project angular2
0

I am trying to use the ts automapper libary
in an Angular2 webpack project but not sure how to import it or include it. An example how to accomplish this would be great.

There maybe be better way to work with this library, however, what I have done in my project is this

/** test.component.ts
    ** Please note that you need to change Path as this is referenced to my node_module and probably it's different in your end.
   **/

///   

import {Component, OnInit} from '@angular/core';

@Component({
  selector: 'test-component',
})
export class TestComponent implements OnInit {
  private jsonObj;
  constructor() {
    automapper.map("JSON", "newType", this.jsonObj);
  }

  ngOnInit() {
  }
}

Keep in mind I have amended tsconfig.json
file to get that to work.

"moduleResolution": "node",

to

"moduleResolution": "classic",

阅读原文...


微信扫一扫,分享到朋友圈

Importing Automapper into a web storage project angular2
0

Hello, buddy!

Big SQL Workload Management – Establishing GateKeeper Controls – Stage 2

上一篇

Deal: $300 off Verizon Samsung Galaxy Note 8, $200 off Galaxy S8, S8 Plus at Best Buy

下一篇

评论已经被关闭。

插入图片

热门分类

往期推荐

Importing Automapper into a web storage project angular2

长按储存图像,分享给朋友