How to route in Angular - Learning Angular (Part 5)

How to route in Angular - Learning Angular (Part 5)

Angular

1 год назад

47,280 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@rembautimes8808
@rembautimes8808 - 08.11.2023 14:21

I really like the content and presentation style. I tried my hand at Angular last year but gave up as I couldn’t get routing. This video gives me confidence to try it again.

Ответить
@graydhd8688
@graydhd8688 - 20.10.2023 04:26

Is this an outdated version of Angular?

Ответить
@adimardev1550
@adimardev1550 - 01.10.2023 09:49

i don't understand why you have to make everything too small when you have the entire blank screen for free. i can barely see a text even in full screen with 4k 14inch lap top. negative comments is positively necessary.

Ответить
@keketsomatsuma6341
@keketsomatsuma6341 - 28.09.2023 15:56

Routing setup does not seem to work, the moment I add "provideRouter(routeConfig)" in the providers array, I get a bunch of error messages one being "Argument of type '{ providers: (ComponentInputBindingFeature | EnvironmentProviders)[]; }' is not assignable to parameter of type '(CompilerOptions & BootstrapOptions) | (CompilerOptions & BootstrapOptions)[] | undefined'.", not clear what's the issue here because even the documentation is the same.

Ответить
@davidcooper4327
@davidcooper4327 - 23.09.2023 16:00

This dude is super positive. It makes me smile.

Ответить
@Z-ANONN
@Z-ANONN - 21.09.2023 17:20

I don't understand why if I follow this tutorial minutiously, I always get ERROR messages that takes me hours of research for no help at all, just confusion and frustration. Then when i finally give up, I just download the code of the lesson, open on vscode and give a npm install and ng serve, then Voilà, the project comes back showing on browser without errors anymore. Seriously, WTF? Angular can be very tiresome, mostly when following Bad tutorials like this. Does anybody know of a Good tutorial beginner friendly we could be following?

Ответить
@obijuank2009
@obijuank2009 - 20.09.2023 14:38

Amazing toturial for beginners

Ответить
@rosendotorres3306
@rosendotorres3306 - 08.09.2023 02:58

main.ts? Where did that come from?

Ответить
@Guy-Scott
@Guy-Scott - 26.08.2023 12:14

I would recommend using Dependency Injection (DI) in a different way as shown in the tutorial.
First, dependencies usually inject in the constructor rather then manually.

Further I believe using the OnInit lifecycle (which is probably left out for simplicity) is often a better idea to do initialization then the constructor.
This is my code:

export class DetailsComponent implements OnInit {
housingLocationId = 0;

constructor(private route: ActivatedRoute) { }

ngOnInit() {
this.housingLocationId = Number(this.route.snapshot.params["id"]);
});
}
}

Ответить
@zeprincelini
@zeprincelini - 25.08.2023 13:55

Hello, great tutorial. My question is, why is the router setup so different from what I have when I add router while creating the project(ng new). Its so different and both yours and mine is angular 15.

Ответить
@CaptainDouchie
@CaptainDouchie - 19.08.2023 13:47

pretty bad tutorial for beginners

Ответить
@Eltopshottah
@Eltopshottah - 20.06.2023 06:38

Thank you Angular team!

Ответить
@jediampm
@jediampm - 21.05.2023 19:19

Hi, few thins to point out:
if you are using v16 and dont use the provide files, the config should be made in a file "call app.config.ts". instead of using "the main.ts" file
- why not inject the deeps of router in the construtor instead of using inject function. what is the diff between inject as constructor params or using inject function?
- in "routes.ts" why not just "export const ..." instead of export default and using naming import?

Ответить
@oussemabouyahia474
@oussemabouyahia474 - 09.05.2023 20:38

i thought that angular dead comparing by react , fortunately three days ago you come up with this tutorial

Ответить