Component Interaction with Services | Services & Dependency Injection | Angular 12+

Поделиться
HTML-код
  • Опубликовано: 7 сен 2024
  • In this lecture you will learn, how to do component interaction using services in Angular. Interaction between two or more components using services is super easy. Let's understand it with an example in this lecture.

Комментарии • 37

  • @dishantrana341
    @dishantrana341 8 месяцев назад +2

    I was trying to learn angular to become full stack but no other tutorial are as interesting as this series. i have tried even paid courses but this is best i have found.

  • @noobCoder26
    @noobCoder26 Год назад +2

    I am learning the most of the useful information about angular from this great Series . Truly the best angular course I came across over the internet .

  • @Viva-07
    @Viva-07 8 месяцев назад +1

    You are awesome..not sure how I missee your channel all these days..hope u get more reach

  • @alidev6882
    @alidev6882 2 года назад +3

    Sir I am following your Angular series from basics and truly appreciate your efforts on such a amazing and premium content, please keep going and also make a series on Angular Material

  • @ShashiKumar-sv5gz
    @ShashiKumar-sv5gz 2 года назад +1

    The best indepth Content on angular.Sir please do more on react and redux also.

  • @mohammedabdulaziz3658
    @mohammedabdulaziz3658 2 года назад +6

    Truly excellent series of services in angular.
    Your every lecture is informative & covering all things like emit and other..
    Really sir , awesome content with dynamic example.
    Please, keep teaching like this only the way you are going.
    & I would ask you about one question related to this video.
    Sir, every time passing an object in emit or passing the date function variable instead of can we use model .ts
    Ex: name : string
    Age : number
    Thank you
    Great!!!!

    • @procademy
      @procademy  2 года назад +3

      Yes. That will be a better approach. In this lecture, i just wanted to shown that we can also specify a type like that. But using a model class is the better and cleaner approach. Thanks

    • @lav4eee
      @lav4eee 2 года назад

      @@procademy Sir, can you make a video with this example using a model class? Thank you anyway, your videos are great!

  • @meysam8357
    @meysam8357 2 года назад +1

    your vedios are really amazing i learned alot from it please make more videos related to front end field

  • @hiteshsharma5948
    @hiteshsharma5948 2 месяца назад

    Finally merry face revealed 🎉

  • @dineshkumar-kl9gr
    @dineshkumar-kl9gr Год назад

    Very good explanation.

  • @universalworthy2169
    @universalworthy2169 Год назад

    wonderful course, thank you very much. Just a little wondering why don't you use Interface in this video?

  • @danlu1578
    @danlu1578 Год назад +1

    It would be good if you make all your sample codes downloadable!!!!!

  • @user-sb4mh6ll2y
    @user-sb4mh6ll2y 10 месяцев назад

    Sorry, but did u already have something in style.css (main one)?

  • @RohitSagar-ke2yn
    @RohitSagar-ke2yn Год назад

    Is it mandatory to direct provider from app component or from child component we can use provider and make the connectivity between componenets.

  • @yogeshmakone6477
    @yogeshmakone6477 Год назад +1

    We can also implement same using @input() and output

    • @procademy
      @procademy  Год назад +2

      Yes. ...but it's easier to use a service than using input/ output decorator....thats what i intended to show through this lecture

  • @rachanachaturvedi6127
    @rachanachaturvedi6127 2 года назад

    Hi your video is amazing and I am enjoying but in this video I am bit confused, always you are using "user" and "users". can you explain where I should give same name or where I can give different name😔 Is it possible to have the code for current video?

  • @user-jn8ht9ww4q
    @user-jn8ht9ww4q Год назад

    When I use a service within constructor that time the component localhost path is not working why it is so??

  • @pauleaster5380
    @pauleaster5380 Год назад

    Just wondering whether you have to copy paste {name: string, job: string, ...} in several places. Can't you define this somewhere? Also, wouldn't the users array be better defined outside the UserService?

    • @JuanHeribertoPoquiomaEsquivel
      @JuanHeribertoPoquiomaEsquivel 11 месяцев назад +1

      (it's late but i think will be worth it for others)
      yes and yes, creating a user.model.ts (a simple class) would be a better aproach and ... usually we use data service to get the data from a database but for the purpose of this video it's ok

  • @narenderkonka9001
    @narenderkonka9001 2 года назад

    will mentions services in app module instead of component level ? so will get any disadvantages ?

    • @procademy
      @procademy  2 года назад

      That should not create any issues and i do not think there is any disadvantages. However it's better to have a separate service class file because it provides seperation of concern and also it will keep your module file leaner.

  • @narenderkonka9001
    @narenderkonka9001 2 года назад

    what is difference between eventemitter vs Observables?

    • @procademy
      @procademy  2 года назад +1

      EventEmitter and observable are two completely different things. You can use observable for handling asynchronous data. On the other hand, you use event emitter to create an event. An event emitter can emit data asynchronously using observable.

  • @054vijayakumark4
    @054vijayakumark4 2 года назад

    ❤️❤️❤️❤️

  • @CHANDRASHEKHAR-hk8sq
    @CHANDRASHEKHAR-hk8sq Год назад

    Hi how i can get source code for this for practice

    • @procademy
      @procademy  Год назад

      github.com/manojjha86/complete-angular-13-course

  • @mubasshirraihan8479
    @mubasshirraihan8479 Год назад

    May we get the source code, so that we can practice without writing html and CSS code.

    • @procademy
      @procademy  Год назад +3

      Here is the GitHub link for this complete series: github.com/manojjha86/complete-angular-13-course

  • @besnik2666
    @besnik2666 Год назад

    this one was complicated

  • @Drak0sha13
    @Drak0sha13 Год назад

    Юзера гораздо проще через атрибут передать.

  • @fizamalik7697
    @fizamalik7697 Год назад

    I have done the same thing that you explain in this video but it displays an error in my code and that is ):
    Compiled with problems:X
    ERROR
    src/app/user-detail/user-detail.component.ts:15:3 - error TS2564: Property 'user' has no initializer and is not definitely assigned in the constructor.
    15 user:{FirstName:string,job:string,gender:string,country:string,age:number,avatar:string};
    ~~~~

    • @MrDeni23n
      @MrDeni23n Год назад

      Iirc from Angular 14, Typescript requires you to initialize a property when you create it (give it an initial value). You can fix this by either giving it a value, putting an exclamation mark (eg users!: {name: string...}) or disabling strictPropertyInitialization (which is probably not advisable).

  • @fizamalik7697
    @fizamalik7697 Год назад

    Can you give me the solution of this problem? @procademy

    • @procademy
      @procademy  Год назад

      The problem is because the strict mode might be set to true in tsconfig.json file. When the strict mode is true, every property you create in a class must be initialized with some initial value. otherwise there will be a compilation error.
      To solve this problem Just go to tsconfig.json and set "strictPropertyInitialization": false .
      or simply assign user property with null.
      I think that should resolve the problem.