Comments (3)
Hello, @alirezabahary
NgOnChanges is not invoked on the mfe component, when you change directive property "inputs", right?
from ngx-mfe.
ngOnChanges is called when an Input Parameter is changed from your parent component.
This lib doesn't pass inputs from mfe directive direct to your mfe-components, so if you want to do something after any detection you should use ngAfterViewChecked()
from ngx-mfe.
If you need pass data and some how to react t changes in this data, you can
If you need to pass data and be able to somehow react to data changes, you can do this:
- Then you can create a new Injector with context
myData$ = new Subject<number>();
const myInjector = Injector.create({
parent: this._injector,
providers: [
{
provide: 'CONTEXT/FOR_MY_COMPONENT',
useValue: { data: myData$ },
},
]
});
- Pass injector to mfeOutletDirective
<ng-container *mfeOutlet="
'my-component';
module: 'MyModule';
component: 'MyComponent';
injector: myInjector;
">
</ng-container>
- And finally get this context from DI in your mfe-component
class MyComponent {
constructor(@Inject('CONTEXT/FOR_MY_COMPONENT') context: { data: Observable<number>} {
context.data.subscribe((data) => {
// do something
// fetch your additional data
});
}
from ngx-mfe.
Related Issues (9)
- Multiple mfeOutlet in the same page. HOT 2
- This is not recognized on outputs HOT 2
- directive does not work when Build for production HOT 8
- nx required? HOT 6
- Provide a way to configure module in an async way HOT 12
- Question: Use your lib with Nx MFE functionality HOT 6
- Any plans for angular v. 16 HOT 2
- Hi :-) any plans for angular 17/18? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-mfe.