Skip to content

Instantly share code, notes, and snippets.



Last active Oct 26, 2015
What would you like to do?
ng-forward ng1 migration (part 1 - alternative)
import { bundle } from 'ng-forward';
import { ComponentA } from './component-a';
// We can create a bundled module from ComponentA
// You can then reference that module elsewhere for
// non-converted components and services
bundle('app', ComponentA);
import { Component, Inject } from 'ng-forward';
// We'll convert componentA first
// Warning: Because we haven't converted serviceA yet,
// ComponentA will just have to trust that serviceA will be available
// We can inject serviceA by name using a string, which can reference any ng1 provider
selector: 'component-a'
export class ComponentA {
constructor(serviceA) { }
(function() {
.directive('componentB', function() {
return ['serviceB', function linkFn(serviceA){}]
(function() {
.service('serviceA', function() {});
(function() {
.service('serviceB', function() {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.