These are chat archives for ngUpgraders/ng-forward

20th
Oct 2015
Hannah Howard
@hannahhoward
Oct 20 2015 19:13
@david-gang you’d want to list A as a directive if you wanted to use it inside a component for B.
David Gang
@david-gang
Oct 20 2015 19:35
A is an angular modyle not a directive
Hi @hannahhoward
I am not sure i understood you properly
A is an angular 1 module
A is a
Angular.module(A).sirective(x,) in angular 1 syntax
X is a directive in the a module
How do i depend on x from a in b?
Tim Kindberg
@timkindberg
Oct 20 2015 19:40
So you have angular.module('a').directive(x) and angular.module('b').directive(y)?
David Gang
@david-gang
Oct 20 2015 19:40
Can u write umport{x} from A ?
Tim Kindberg
@timkindberg
Oct 20 2015 19:40
no you can't write that
The ES6 module system has nothing to do with the angular (or ng-forward) module system
they are apples and giraffes
David Gang
@david-gang
Oct 20 2015 19:41
Thanks @timkindberg
Tim Kindberg
@timkindberg
Oct 20 2015 19:42
Your question is a bit unclear to me
how are you trying to incorporate ng-forward?
David Gang
@david-gang
Oct 20 2015 19:42
Sorry. I try
Tim Kindberg
@timkindberg
Oct 20 2015 19:42
It only sounds as if you are trying to use ES6 import syntax (which is not ng-forward)
are you trying to use any ng-forward things like @Component or something?
David Gang
@david-gang
Oct 20 2015 19:43
To take an existing angular application with mpdules
And try to migrate it to angular 2
Naturally it is a big application and i dont want to miss the modularity
In mg-forward what is the equivalent of angular.module?
In amgular 2 i can use es6 module instead of angular.module
But what can i do in mg-forward
This is my question
I hope it is clearer than my example
David Gang
@david-gang
Oct 20 2015 19:50
The reason I think ng-forward is better for my needs than ng-upgrade is that all of my third party modules dont exist yet in angular 1 including angular material
Therefore is ng-forward the intermediate step i need
Tim Kindberg
@timkindberg
Oct 20 2015 19:54
We hide angular module away we auto create one for you when you call bootstrap
you can add ng1 modules though
@Component({
selector: 'app',
providers: ['myAngular1ModuleName', SomeNgForwardInjectable]
})
class AppComponent{}
so providers takes both strings and annotated classes
strings are treated as ng1 modules
David Gang
@david-gang
Oct 20 2015 20:00
Thanks. But all components created by the@component annotation are created in one module
There is no way to say that @appcomponent is a part of a module
Is this correct?
Sorry
All @component
Are put in one module
There is no way to say that appcomponent is party of a module
Tim Kindberg
@timkindberg
Oct 20 2015 20:04
correct, no way to do it
is it important?
we felt it was unneeded now
bundle (another method in ng-forward) will bundle any number of ng-forward "things" into a module
without bootstrapping
it returns an ng-forward module, which is just a wrapper around the ng1 module object
but you can get it's name with .name and add that string to an angular 1 module
David Gang
@david-gang
Oct 20 2015 20:06
I have an existing angular application with modules and i dont want to lose the modularity
The bundle option looks interesting
Tim Kindberg
@timkindberg
Oct 20 2015 20:06
let componentModule = bundle('myModuleNameIWant', MyNgForwardComponent);
angular.module('anotherModule', [componentModule.name])
David Gang
@david-gang
Oct 20 2015 20:09
Thanks. I will try to play with it tomorrow. It would be great to add an example of tgis use case in the readme. Thanks for your prompt help
Hannah Howard
@hannahhoward
Oct 20 2015 21:33
@timkindberg — did bindings change to providers?
Tim Kindberg
@timkindberg
Oct 20 2015 21:34
Yep