Комментарии:
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.
ОтветитьIs this an outdated version of Angular?
Ответить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.
Ответить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.
ОтветитьThis dude is super positive. It makes me smile.
Ответить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?
ОтветитьAmazing toturial for beginners
Ответитьmain.ts? Where did that come from?
Ответить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"]);
});
}
}
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.
Ответитьpretty bad tutorial for beginners
ОтветитьThank you Angular team!
Ответить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?
i thought that angular dead comparing by react , fortunately three days ago you come up with this tutorial
Ответить