wwwalkerrun / nativescript-ngx-magic

Magically drop a NativeScript app into your Angular web app and reuse all your code.
MIT License
48 stars 8 forks source link

Component decorator pattern #8

Closed Jonatthu closed 7 years ago

Jonatthu commented 7 years ago

Hello, I was seeing this repository from you https://github.com/NathanWalker/angular-seed-advanced/blob/master/src/client/app/components/app.component.ts

I noticed that this is not following the next pattern that you are saying here in the docs

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

// just comment this out and use Component from 'angular/core' // import { Component } from 'nativescript-ng2-magic';

@Component({ // etc.

Why is this?

NathanWalker commented 7 years ago

Hi @Jonatthu sry for late reply. The advanced seed uses a slightly more sophisticated setup allowing the standard Component decorator from '@angular/core' to be used. It uses some clever gulp scripts to allow standard decorator to be used in builds and in livesync dev workflow.

Similar advancements will come to this library in time. It will eventually allow the standard Component decorator to be used by installing a webpack loader which could be used with the angular cli for example.