Skip to content

Instantly share code, notes, and snippets.

Last active May 11, 2016
What would you like to do?
ng-forward ng1 migration (after)
import { Component, bundle } from 'ng-forward';
import { ComponentA } from './component-a';
import { ComponentB } from './component-b';
selector: 'app',
directives: [ ComponentA, ComponentB ]
export class App { }
// Now that we've got all the things converted, we can move our bundle call
// to the top most level of our app. Bundle will follow all the dependencies
// via the directives and providers properties to include them all in one bundled module
let module = bundle('', App);
// If you need to further use this portion of your app in an even bigger portion
// just repeat the process up the tree. Here is now a reference to this module.
export default;
import { Component, Inject, bundle } from 'ng-forward';
import { ServiceA } from './service-a';
selector: 'component-a',
providers: [ ServiceA ]
export class ComponentA { }
import { Component, Inject, bundle } from 'ng-forward';
import { ServiceB } from './service-b';
selector: 'component-b',
providers: [ ServiceB ]
export class ComponentB { }
import { Injectable } from 'ng-forward';
export class ServiceA{ }
import { Injectable } from 'ng-forward';
export class ServiceB{ }

This comment has been minimized.

Copy link

@prbaron prbaron commented May 11, 2016

Do you really need Inject and bundle imported in components ?

Where did @Inject(ServiceA) go ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment