This is just amazing man!! I just started to learn Angular myself, and this video is the best one I could find from the Internet that explains this term in just an easy the understandable way!! Keep up the fantastic work, I would definitely like to subscribe to your courses if you publish them somewhere on Udemy or your own site.
Thank you for explaining all the concepts in such a simple manner. All your videos on Angular have been very helpful for a beginner in Angular. I can draw a parallel to other UI technologies I have worked on very easily with the information I have gained. Thanks a lot.
Thankyou very much sir, because all 14 lectures were really excellent and it is understandable by buddy lerner. all your lecture related to angular were awesome..., i personally recommended your lectures to my friends and new comers and students...
Hey! Codevolution, can you expand this series more deep on using calling data from web services and then interact over it using RxJs with more example ?
This series is very helpful in right time.. Thank you my friend. Please can upload video or suggest the best project structure for admin panel or application.
Sir, As a request can you also give one example using Object with many properties for parent and child interation.. eg: Student (id, firstname, lastname, rollnumber) should be accesable in parent component which is teacher.
I just saw you asked this 2 years ago, but maybe it helps someone new to this. If I understand you right, it should be the same principle. For the object you want to pass to your parent, you could create an Interface which contains all properties that you need in an external file. So: "export interface Student { id: string; name: string; age: number; }" After that you can import this where u need it and use it as a data type, so instead of string you will use your own custom data type / object and can pass it in to the subject stream to be received by subscribers. You could also use this object with Input or Output if the components are parent or child. Hope this helps you! 👍
Thank you very much for this amazing explanation. Really helpful. Just one thing... In order to ensure no memory leaks, we need to unsubscribe inside ngOnDestroy() method. Am I right?
You don't need to use .asObservable, Subjects are Observables, but they are unicast(send same data to all components) Observables are multicast, can send different data, so this cause unexpected results.
This seems to be like a Parent-Child interaction, will @Input and @Output do the same thing? I thought this was more like a sibling component interaction.
In my case, where I am using a [router-outlet] to generate router animations, I don't include the child components tags in the parent component template because it's taken care of by the router. So, it's not possible to use @Input. This is where a service is useful in a Parent-Child situation. But a service can also be used for sibling and non-related component interactions too. The whole point is that they are hierarchy-independent.
What is the downside if I only use Services for all app wide component interaction throughout my application? I kinda think Services is like the Controller in MVC concept. Shed some light to me a newbie here.
Hi, i am totally new to angular and i want to know if the observable can parse boolean values? coz i tried which show error that "property 'subscribe' does not exist on type '() => Observable' "
yes, you can. Suppose, Let say the api holds the images in base 64 format. Subscribe to that api using a service and retrive the values. Perform base 64 conversion and voila, you are there. :)
Can we make like inside one component folder i will create one more folder by giving different name component and first component will consider parent and inside component as child?
Angular is basically component base framework. Say you make web app with 2 pages - Home - About So you create those components and you have - Home component - About Component Now you can insert those component selector to App component which is main component. App component > Home component > About component In this case app component is the parent and other two components are child.
What are you planning to accomplish exactly? From what I understand, that's why we have service which is a method that can be call in multiple components. I am not sure why do you want to call method from one component on the other. In theory you can do it by injecting method from one component to other component and also set it as provider.
is there any differences between writing what shown in the video and this?? ------------------------- service.ts: private _subject: string; public behaviourSubject: BehaviourSubject = new BehaviourSubject(this._subject); public updateBehaviourSubject(value: string){ behaviourSubject.next(value); } ------------------------ child.component.ts this.serviceName.behaviourSubject.subscribe (value => { //stuff } ) ty :)
@Codevolution I want to create two pages named registration page and set password page as two separate components. When I click on the next button on register page it takes me to set password page where I set password and click register. What should I do to submit the data from both register and set password pages on clicking register button. Any help is really really appreciated. Thanks in advance.
I am not sure which part of the video you don't get it. You are asking question in the very same video that giving you the answer. Selector is use with parent and child. You are in this video which is using service. - Learn more about Angular service - Learn Rxjs - observable, subscribe and service.
the real problem is that i'm getting the actual passed data into the "message" mentioned in the subscribe() but i'm unable to assign it to a global variable