Last active
May 22, 2019 12:46
-
-
Save sanketmaru/c711661884da88716f7d8f5800c6771b to your computer and use it in GitHub Desktop.
Notes on DOM Manipulation Workshop by Maxim NgWizard Koretskyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notes :- | |
1. Split Presentation and Rendering Logic. | |
2. ViewChild is evaluated in the ngAfterViewInit hook where as for a directive INput params are | |
evaluated in OnInit lifecycle hoook. | |
3. Using renderer so its platform specific and rendered evaluates working inside platform for web, web worker, mobile. | |
4. ViewContainers = Structural Directives are based on view containers. ngIf, ngSwitch. | |
5. ng container and view container is different. ng contianer acts as a view container. | |
6. Embedded view and host view. Host view are attached to DOM and embedded views are always part of view container. | |
7. Why do we need dynamic components. We do not know which component to render using ngIf. For more that 100 components ngIf | |
is not a scalable solution. | |
Dynamic Components :- | |
1. Add Components to entryComponents so that factory is created and can be resolved using factory resolver. | |
2. Add a view container so that the dynamic components can be embedded. | |
Questions:- | |
1. Why directive selector name and input needs to be same. Cant Input be anything ? Can we provide multiple attributes ? | |
2. How do you set Focus with a renderer. There is no setFocus on renderer. | |
3. How to remove child elements with view container as Angular still keeps tracks of views even if DOM node is deleted. | |
Change detection is still going on with child elements. | |
4. Should we add a node to DOM diectly or always using ViewCOntainerREf. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment