Тёмный

Why does building an Angular app with INJECTION TOKENS feel so good?! 

Joshua Morony
Подписаться 74 тыс.
Просмотров 16 тыс.
50% 1

My Angular course: angularstart.com/
We take a look at using the createInjectionToken function from ngxtension to build an Angular application using functions for services instead of classes.
Get weekly content and tips exclusive to my newsletter: mobirony.ck.page/4a331b9076
Want to build mobile apps with Angular?: ionicstart.com
0:00 Introduction
0:58 What are injection tokens?
1:42 Services as injection tokens
3:06 Providing the service
3:57 Thoughts
#angular
- More tutorials: modernangular.com
- Follow me on Twitter: / joshuamorony

Опубликовано:

 

11 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 92   
@JoshuaMorony
@JoshuaMorony 6 месяцев назад
Go subscribe to Chau's channel: www.youtube.com/@ChauTran
@user-hs9uf8fg5k
@user-hs9uf8fg5k 6 месяцев назад
this is a dead channel
@chaos_monster
@chaos_monster 6 месяцев назад
Honestly and I will be called old for this, but the idea isn't new we had similar things in the past (see Angular.js) and I was absolutely happy to see Angular (2) commit to services as classes. Yes not everything (looking at you router guards) has to be a class, but to me this approach is much cleaner and encapsulated. the function approach mixes properties, constructor and jumps around the scope. I am really worried to see this more and more pushed
@CaseAhr
@CaseAhr 6 месяцев назад
I thought the same thing. Looks like an AngularJS service.
@wassimmehanna4402
@wassimmehanna4402 6 месяцев назад
Oh thank you! I prefer a known approach instead of trying to reinvent the wheel.
@stephenjames2951
@stephenjames2951 6 месяцев назад
Claiming this is "cleaner" seems arbitrary at best. For me it reaches into the internals of Angular which might change in the future. The use of the decorator @Injectable makes it very clear what is going on.
@imadelhitti8677
@imadelhitti8677 6 месяцев назад
Totally agree !
@marceldeger7487
@marceldeger7487 6 месяцев назад
I would never implement this in a project that a team is working on for the single reason that everyone is used to the class-based way. It is unavoidable that people would eventually start mixing these methods and everything would just become rather messy than clean. It also makes the learning curve for beginners way harder, because they might not even understand the concept of InjectionTokens. All that being said, thanks for explaining us these new approaches/patterns.
@e-jarod4110
@e-jarod4110 6 месяцев назад
I disagree because all we need is a team specified convention And JavaScript itself is multi paradigm, so I don't find it weird to mix classes and functions, especially when it will force remove class inheritance
@marceldeger7487
@marceldeger7487 6 месяцев назад
@@e-jarod4110 if you have worked in bigger companies, then you would know that team members tend to change, juniors are being hired every now or then and conventions are not always being followed, especially not when people set bad deadlines with "smelly code" as results. Besides that: You write typescript with angular (which is very opinionated) and new developers will have to adapt to your different ("unconventional") angular pattern, which will end up in higher costs (time/productivity) Your general angular knowledge can be applied to every angular codebase that is following the "intended" code-style (im using the word "intended" very carefully here) and this is a good thing, otherwise you will end up with a messy React.js 2.0, where every single project is a new learning rollercoaster
@MartinPultz
@MartinPultz 6 месяцев назад
Feels like a throwback to AngularJS factories. If I see an object with methods, and we're only exposing some of those methods then use a class with public/private accessors. I find this approach to have a higher cognitive load than a class.
@kylerjohnson988
@kylerjohnson988 6 месяцев назад
In isolation, I agree that this service has a higher cognitive load and is more complex, but only marginally. What about in an actual app? In typescript, class members are public by default so encapsulation is an after-thought. As a result, most Angular services I’ve seen expose too much leading to a larger than necessary public API surface and even allowing things outside of the service class to change what’s inside of it. In my experience, such an implementation can have a pretty gnarly cognitive load. That’s why class members in languages like C# and Java are private by default. With the solution in this video, service members are private by default so exposing them requires deliberate action, which would ultimately lead to better encapsulation and a lower cognitive load in the scope of the larger app.
@MartinPultz
@MartinPultz 6 месяцев назад
@@kylerjohnson988 fair point but I feel like deliberately making them public isn't enough at least not for myself. My team knows to start out private and only make it public when necessary and we enforce public accessors and accessor order through eslint. It's the same process applied to using const until you know you need let.
@erikmo001
@erikmo001 6 месяцев назад
I understand why some might view this approach as "superior," however, I disagree. Adopting it would transform the Angular application into a mixed object-oriented project, increasing complexity, despite still being considered "clean". The advantage of default private properties doesn't justify this change. Although guards and resolvers are functional too, it's acceptable since they simply supply a function to Angular's internal workings. So, at the end, why should I bother doing it this way?
@JoshuaMorony
@JoshuaMorony 6 месяцев назад
Mixing OOP/functions doesn't really both me, imo the biggest reason not to adopt this approach is the inertia/standardness of the existing approach - and as you mention the benefit probably isn't strong enough to justify sweeping changes. So I don't really think anyone "should" use this approach unless its what they want to do, but I do think experimentation with stuff like this is great and ultimately what helps improve and shape the DX of Angular as it and the community evolves over the years.
@erikmo001
@erikmo001 6 месяцев назад
Experimentation and demonstrating potential capabilities are always beneficial. :)@@JoshuaMorony
@kylerjohnson988
@kylerjohnson988 6 месяцев назад
Some of the worst code I've worked on in my career was when developers tried to stick to either the functional or the OOP paradigm. The best code bases I've worked in used both paradigms where they made sense. I've always used classes for services (and of course components), but inside of them, I take a more functional approach because it ends up being more declarative/readable. I'm not sure I prefer this functional approach for services yet, but I definitely see some benefits: 1) It prevents inheritance. I come from a C# .NET background and I'm well-versed in inheritance, but in my career building and maintaining enterprise scale Angular apps, I've come across very, very few use cases where base classes were a better solution than another more generic service. I've so often seen unnecessary inheritance cause a lot of unnecessary maintainability problems. This approach prevents inheritance and more often than not, that will be a good thing for maintainability. If this were the default way to write services, I think people would consider more carefully whether inheritance is the right solution because it would mean breaking this convention (which I think is fine when it's warranted). 2) Private members by default are a huge benefit when maintaining enterprise scale applications and I wish that was the default behavior of Typescript classes. The Typescript team wanted to go that route, but the necessity of remaining a superset of Javascript prevents them. Java and C# both take this private-by-default approach in their class implementations, and I think it makes a ton of sense because it forces you to be deliberate about what gets exposed because consumers of the class can't do what they need to do unless they're exposed. So I think that's a massive benefit to this approach. I'm still not sure how I feel about this overall or if I'm going to switch to this approach, but I definitely see these benefits and I think it warrants consideration.
@marcush3997
@marcush3997 6 месяцев назад
I started my career by doing a migration project from ng1 to ng2 and oh man how I hated ng1. This seems too similar to how ng1 dealing with DI and the PTSD is so real and triggering
@Ba_Dashi
@Ba_Dashi 6 месяцев назад
2:32 "Rather than using a class we are using a function" - I mean, JS classes are syntax sugar for certain kinds of functions anyway. What you're doing here is essentially creating a factory function that returns an object. You can use things like `satisfies` to guarantee that the resulting object adheres to a certain interface, and you have a bit of a harder time to reason about this when your team comes from a C# or other OO-based background. I don't think this is bad per se, and I can see this being useful for small services(which should be more common IMO), but you shouldn't do this for every possible scenario IMO. Classes are useful for encapsulating and reasoning about inner state too, and there's a reason that JS has a class syntax.
@NeroG4ming
@NeroG4ming 6 месяцев назад
Either I am too stupid to understand it, but I see in now way why this is a better approach. You do not write less code, it even looks the same so why throwing now injection tokens in the ring if everyone is happy about using classes, which everyone understands from the get go.
@ico0z
@ico0z 6 месяцев назад
Please do not repeat the React thing when replaced classes with functions and everything went down
@HoNow222
@HoNow222 5 месяцев назад
yup exactly
@vladimirv.443
@vladimirv.443 6 месяцев назад
4:05 class looks better and clearer
@shunz5677
@shunz5677 6 месяцев назад
Feel the same. It's not Angular anymore for me with that function approach. It's closer to AngularJS, and I used to hate AngularJS :D
@tomastrajan
@tomastrajan 6 месяцев назад
General problem with naming, a "function" service comes with a different set of assumptions than a "factory function" which creates and object which exposes things from closure (as a service) is what were dealing with here... "functions created by injection tokens" - no function being created, factory function runs and creates a closure and a "public API object" that is used by consumers. "we can use custom injection token that returns a function as a service" - no function is being returned, factory function runs and creates closure and "public API object" which is returned to the consumer There is no function service... just a factory fn which creates a closure for private state and behavior and returns an object that exposes parts of it Then based on if it was for root or individual injectors, we will get one (shared API object) or multiple unique ones In that way it does exactly the same as class constructor, so what we get is a class, without calling it a class....
@JoshuaMorony
@JoshuaMorony 6 месяцев назад
These are good points and I think I should've been more accurate with the phrasing in the video
@jhadesdev9576
@jhadesdev9576 6 месяцев назад
I don't see any advantage in terms of readability. The code would be less maintainable in the sense that new developers would have to be trained to understand this pattern. Instead of dealing with just the simple concept of a service that everyone understands, now everyone on the team needs to know about injection tokens, which is an advanced and rarely needed dependency injection concept. I think this is a good example of over-engineering, playing with an advanced concept just because we can and to scratch an itch, without thinking of the consequences for rest of the team maintaining the code.
@adambickford8720
@adambickford8720 6 месяцев назад
100%. I shouldn't need to understand the entire NG iceburg to get a reference.
@kylerjohnson988
@kylerjohnson988 6 месяцев назад
I’m not saying this is the way to go, but you don’t see the advantage in a private-by-default approach that requires deliberate action to expose members? This approach, while more complex, does offer a better default for encapsulation. Typescript class members are public by default and I’ve seen that cause maintainability nightmares in large scale apps. I really wish Typescript class members were private by default like in C# and Java. Again, I’m not saying we should all do this or that this benefit outweighs the drawbacks. I’m just saying that it is a benefit of this approach and it’s worth thinking about.
@sulaimantriarjo8097
@sulaimantriarjo8097 6 месяцев назад
A new approach to do things like always. It is good to have different approach but I like using the class one as it is more familiar
@vanderdill
@vanderdill 6 месяцев назад
As an experimentation I think this is valid. But, for this case, there is no gain that justifies changing a widely known pattern.
@Daniel-dj7vc
@Daniel-dj7vc 6 месяцев назад
Yes. But why?
@asyncpipe
@asyncpipe 6 месяцев назад
I like the standard way of having injectable services as classes. I don't see any benefit of using this new approach, what am I missing? Maybe it's just my object oriented mind making me think so
@rembautimes8808
@rembautimes8808 Месяц назад
I’m gonna try to use Dependency injection to build a templatised Signal Store. But will have to rewatch Decoded Frontends DI videos - they were gold
@RaonakDM
@RaonakDM 6 месяцев назад
The class based approach seems easier to read and easier to understand.
@razafiarisonmichael4421
@razafiarisonmichael4421 6 месяцев назад
Thank you for sharing the idea, you make great contents about Angular, keep it up ! I think it's up to everyone to choose which approach they prefer but up until now I find the OOP easier to read and structure big scaled apps. I don't have good memory so I prefer using something easier to read
@pedrinhofernandes
@pedrinhofernandes 6 месяцев назад
Interesting that this can be done, but tbh looks less readable and way harder to understand for devs with less experience.
@Krzych616
@Krzych616 6 месяцев назад
100%
@adambickford8720
@adambickford8720 6 месяцев назад
This is unintuitive and the gains are subjective at best. I would reject this PR with extreme prejudice.
@JoshuaMorony
@JoshuaMorony 6 месяцев назад
I probably would too - the point of this video isn't to say everyone needs to start using this approach, which is why I said I would only use this in personal projects that I am working on alone. I like it, but it's probably not worth going against the grain right now. I still think its important to experiment with ideas like this.
@Krzych616
@Krzych616 6 месяцев назад
@@JoshuaMorony It does seem like angular is moving away from the opinionated approach allowing more and more - for some that may be a good thing. But on the other hand, there is a risk of ending up with a project overly complicated with multiple approaches to solve problems. The clear guidance and structure from angular was always a benefit in my opinion - especially for big project where multiple teams need to collaborate on code base.
@lucasgiunta8874
@lucasgiunta8874 6 месяцев назад
in fact it is the translation of the john papa pattern for the angular js services years ago hihi.
@NoName-1337
@NoName-1337 6 месяцев назад
This is something like AngularJs back then. A Provider. Back to the roots.
@NuradinPridon
@NuradinPridon 6 месяцев назад
It has often bothered me that developers mistake simplicity at different scales of applications. Sure, if you are building a "to do" app this is an overkill but serious projects have different requirements: they should be easy to scale and extend, so at the lower level some not-so-simple methods must be employed. Injection tokens can keep the project abstract since every token can be provided with different values and therefore it is extendable. The DX is so much better when you don't have to change large chunks of existing code just to add a new feature onto it.
@adambickford8720
@adambickford8720 6 месяцев назад
You do realize thats the entire point of DI, right?
@NuradinPridon
@NuradinPridon 6 месяцев назад
@@adambickford8720 The point is, I wish more people did. You ask most Angular developers what DI is, and they will only say singleton services.
@Brumry
@Brumry 6 месяцев назад
A very interesting idea. I have seen this with firebase, as the example you showed, but I was a bit put off by it since I am used to classes. One thing that comes to my mind is testing functions ? But on the other hand, almost nobody write tests, so that's fine. Nonetheless thanks for the example.
@JoshuaMorony
@JoshuaMorony 6 месяцев назад
I haven't actually tried testing with the injection token service approach yet, but I don't think it would cause any issues - at least not with the way I generally test. Testing code outside of the service you can easily mock with DI as usual, testing the service itself I would just be interacting with its public API and testing what happens.
@async_YT
@async_YT 6 месяцев назад
I like class approach but this is also good to know 👍
@fieryscorpion
@fieryscorpion 6 месяцев назад
Hi, Does your angular course have content on testing, auth and integrating with backends like .NET APIs? Also can you please give some discount or coupon code for your Angular course? I'm unemployed at the moment and would like some help if possible. Thank you!
@riatec6741
@riatec6741 5 месяцев назад
What is the need to change into the functional approach when most companies has only mid level engineers ?
@ObiWanKenobi_IceNation
@ObiWanKenobi_IceNation 4 месяца назад
I can't help but look at this approach and see Vue composables, but with more boilerplate needed / harder to read.
@todorklasnakov2202
@todorklasnakov2202 6 месяцев назад
AngularJs was like this. Everything is private and the service expose only what you return from it
@Tjommel
@Tjommel 6 месяцев назад
i think this is more an typical javscript issue: Having multiple things that are doing the same. As someone who comes from AngularJS (when it was called Angular ;-)), this is more of a throwback for me and makes it even more hard to mange multiple code sources for/with multiple developers. I would hardly remocmend staying for 1 solution or at least make a "code guidence" so there is no "wild west" in the code just because there are "cooler/other ways" to do it without a benefit.
@RonnieBanerjee007
@RonnieBanerjee007 6 месяцев назад
As a developer this makes my head hurt, and it's not a good thing.
@Qellson
@Qellson 6 месяцев назад
People complaining on overcomplicating..... "Hold my beer" - Joshua Morony Great content! Thank you!
@alandragicevich2421
@alandragicevich2421 6 месяцев назад
Aren't classes more efficient if there are multiple instances? Sharing methods via the prototype.
@JoshuaMorony
@JoshuaMorony 6 месяцев назад
That's an interesting point, I suppose this would need to be profiled but I would be surprised if it made any significant differences on memory - especially in the case of creating services where you're often only going to have one instance of it anyway (even for non-root services we still would typically only have one provided to a specific component). I can't say with confidence since I've never tested this before, but I assume you would need to have a lot of instances of something for this to be a factor to give any weight to.
@alandragicevich2421
@alandragicevich2421 6 месяцев назад
@@JoshuaMorony yea. I think a function/object would use less memory than a class if its a single instance.
@mikemarkovich69
@mikemarkovich69 6 месяцев назад
I'm imagining our or any greener devs seeing this in an application they're assigned to and immediately getting wildly confused. I'm not sure this is worth the effort. This feels like something you'd want in an app that's private to you.
@ragnar-the-giant
@ragnar-the-giant 6 месяцев назад
I don't like this approach. Angular has clear and strict guidelines. It's fully based on OOP. And do you know what? I like it. In the end, it would be good to have an option to decide if I want to use classes or just functions. But if I now start to mess up this strictness with functions for services, it feels just wrong. There is really no need to always try to move everything to a functional approach just because it seems to be trendy. In the end, it is a personal opinion. But, as I said, please follow the standards in Angular and don't do it like this.
@vutruong4164
@vutruong4164 6 месяцев назад
Standards/patterns emerge, go thru general usage, and constantly evolve to add functionality and/or shed unnecessary weight. NgModule was standard, now it is not even included in the starter app generated by angular cli anymore, and I believe hardly anyone miss NgModule, it adds little to code organisation and overcomplicates so many things else. *NgIf, *NgFor were standard common module. Now they are on the way out, being replaced by more performant, built-in control flow @if, @for, etc The pattern this video showcases is being used to build the new NgRx Signal Store. All I'm saying is, keep an open mind and maybe one day you'll find this pattern is useful in some cases, rather than be dogmatic about what are "standards".
@kylerjohnson988
@kylerjohnson988 6 месяцев назад
Angular has never been fully OOP, but it is mostly OOP. RxJS is functional and has always been a necessary part of Angular 2+. Also, I'd argue that taking a functional approach to class methods makes things more testable and results in a more readable, declarative code base. For example, I've often seen components with methods that handle DOM events (i.e. click handlers) and in that method it references a property (or properties) on the component class outside of its scope. Afterall, that's the OOP pattern most folks are familiar with coming from Java or C#. A better approach is to reference that property in the template and pass it into that method as a parameter. That way the method is only concerned about what's inside of its scope and the developer only has to look in that one place to see what's happening. There are places where the functional paradigm makes things simpler and more declarative. I don't think anyone is doing it because it's "trendy". I think people are doing it because the functional approach solves a specific problem they've run into. While I'm not sure I prefer this approach to services yet, private by default is an important encapsulation concept and a major benefit to this approach. Most OOP languages treat class members as private by default (like Java and C#) and I think that's a superior default compared to the public by default approach Typescript takes with classes. With years of experience maintaining enterprise Angular code bases, I think the benefit here _may_ outweigh the cost of the slight increase in complexity.
@omarkarim9298
@omarkarim9298 6 месяцев назад
Closed mind 😂
@sakubdev52
@sakubdev52 6 месяцев назад
Honestly… I don’t like this approach, it kinda looks like angular trynna be like react
@nthonymiller
@nthonymiller 6 месяцев назад
I love this idea, I use much the same concept but use facade classes instead.
@CanalDoFante
@CanalDoFante 6 месяцев назад
Feels like a throwback to angular factories, honestly it feels dated and increases cognitive load and code readability, my initial reaction is quite against it
@JoshuaMorony
@JoshuaMorony 6 месяцев назад
Certainly understand not liking the approach - old approaches can be valid though, take the eventual arrival at signals so many years after knockout.js. Imo the biggest aspect of cognitive load/readability here has more to do with the unfamiliarity than the approach actually being more complicated - it's still a valid criticism/concern because there is value in the established familiarity of approaches. I think given the two options without any established approach the function based approach would be appealing. For the most standard approach it becomes a choice between: 1) Create a class that uses an "Injectable" decorator, within that provide a configuration to specify that it should be provided in root, you can then inject the service using the class 2) Supply a function to the createInjectionToken function, it will return a function that you can use to inject the service where you need it
@Wielorybkek
@Wielorybkek 6 месяцев назад
thanks for the video, it's an interesting approach. the more I think about it the more I like it.
@daniellynch3724
@daniellynch3724 6 месяцев назад
I think I missed the “why”
@ryanngalea
@ryanngalea 6 месяцев назад
Might as well drop Angular at this point, It's strict for a reason.
@Krzych616
@Krzych616 6 месяцев назад
Why I get react wibe..... XD
@mikitahimpel3283
@mikitahimpel3283 6 месяцев назад
Great idea. The more solutions like this there are, the harder Angular will become, and the quicker Google will shut down this project, leading to less use of this framework. I can only support such an initiative.
@3pleFly
@3pleFly 6 месяцев назад
Reminds me of react. I love it. Angular seems very promising in the future with its adoption of signals. Just a bit of everything
@HoNow222
@HoNow222 5 месяцев назад
Reminds me of react. I hate it.
@user-ed2zi5qp9g
@user-ed2zi5qp9g 6 месяцев назад
I love functional programming, but this seems over engineered and archaic
@AlexanderYaremchuk
@AlexanderYaremchuk 6 месяцев назад
i think explanation is a bit unclear in this video.
@jerrytab4276
@jerrytab4276 6 месяцев назад
The function should been put in trash in the first place😅
@Netrole
@Netrole 6 месяцев назад
Doing things different just for the sake of it. I get that you need to push for things like that, as there is not a lot of content to be made on standard patterns everybody knows and uses. But i see no real benefit to this, and honestly it looks quite messy and it seems to add a whole lot of unnecessary boilerplate code.
@kylerjohnson988
@kylerjohnson988 6 месяцев назад
This is not different for the sake of being different. This is the most overused criticism I see in the tech world and isn’t helpful for anyone. These things always have trade-offs that you have to evaluate for yourself, your team, and your project requirements. The benefit to this approach is that service members are private by default and exposing them requires deliberate action. This is a better default for encapsulation, which is why languages like C# and Java decided that class members should be private by default. In typescript, however, class members are public by default and that’s not great for encapsulation and I’ve seen it cause a lot of maintainability problems in moderate to large apps. This solution comes at the cost of a break in convention and a bit more complexity, but for some, the benefit of private by default may be worth the drawbacks. Is it for you? I don’t know. That’s for you to decide.
@Emekaelo
@Emekaelo 6 месяцев назад
Nope
@Fadi.nouh88
@Fadi.nouh88 6 месяцев назад
This is over engineering foe nothing
@chaos_monster
@chaos_monster 6 месяцев назад
You're overcomplicating things, without a real benefit - I know you do not like my opinion.
@JoshuaMorony
@JoshuaMorony 6 месяцев назад
I see this largely as a preference - while I do think there is *some* concrete benefit to this approach (specifically the strictness it introduces to defining the public API) I don't think it is of much consequence. I still don't see it as an over complication, because personally I find the pattern simpler/nicer, but I also wouldn't push it on other people at this point which is why I mentioned that I'd only use it in personal projects at this point.
@kylerjohnson988
@kylerjohnson988 6 месяцев назад
I disagree. Most OOP languages (like Java and C#) make class members private by default, which forces the developer to be deliberate about what they expose to consumers. Typescript classes are the opposite and I've seen that cause a lot of maintainability problems. In other words, Typescript offers no encapsulation by default. Private by default is objectively a far safer default than public by default. This approach to creating services provides that private-by-default functionality, which is a MAJOR benefit. You don't have to agree with this approach if you feel like the complexity outweighs the benefits. But to say there is no real benefit is flat out wrong. With years of experience maintaining enterprise scale Angular apps, I definitely see the benefit to this approach. I'm not sure that it's my preference yet or that I will take this approach, but the benefit is definitely there.
@chaos_monster
@chaos_monster 6 месяцев назад
@@kylerjohnson988 I am not sure if you picked the right comment? But to answer your concern about encapsulation in JavaScript classes (!). Private properties exist and the private pattern in JavaScript is really nothing new and I considered it hacky back when I've seen it the first time
@tomastrajan
@tomastrajan 6 месяцев назад
@@kylerjohnson988 if this was an argument, then it can be automated by a linter which would enforce explicit use of "public" else everything else has to be declared "private" (or even better, ts compiler flag in the future) I think it all boils down to the fact that seeing function comes with a set of assumptions like: we call it, 0 to n times, and we get a result (or error) eg ... sum(2,2) -> 4 TodoList(todos) -> HTML Having function TodoList {} which only runs once as it's in fact a factory (for instructions or whatever) and that it is not re-run on every change breaks this assumption Now when I (and many folks) see class, ... There is implicit assumption that this will run ONCE (to create an instance) which then lives (till it's destroyed, and has state and behaviors , ...) As such I still would argue that CLASS expresses the reality of something like Angular (or even Solid.js component) in more precise way! Can it be factory function, obviously, works in solid, but then we have to always think... Is this a "standard" function or "factory" (with lots of implicit hidden consequences) Using both class and function removes this step as its immediately obvious.
@The14Some1
@The14Some1 6 месяцев назад
@@JoshuaMorony I believe you've become a little bit obsessed by everything being "functional" idea, which has gone too far. Functional approach has reasoning and you shouldn't write everything like that just because it feels fancy. While i see the beauty of functional code, I also respect another beauty of the mvc+oop paradigm, praised by Angular in it's cornerstone, and considering this it feels unnatural and irreverent to write like that without a solid reason.
@RyanWaite28
@RyanWaite28 6 месяцев назад
I find this approach to be highly unnecessary.
@JetSnowman
@JetSnowman 5 месяцев назад
I hope nobody is going to use it
@user-hs9uf8fg5k
@user-hs9uf8fg5k 6 месяцев назад
where is code link? dislike
@user-hs9uf8fg5k
@user-hs9uf8fg5k 6 месяцев назад
your method is shame
Далее
ngTemplateOutlet is WAY more useful than I realised
16:36
Типичный продавец на пляже 😂
01:00
Why Does Scrum Make Programmers HATE Coding?
16:14
Просмотров 490 тыс.
The Story of Next.js
12:13
Просмотров 537 тыс.
The inject function in Angular is not just a toy
3:55
I bet you can understand NgRx after watching this video
22:48
The mindset you need for a DECLARATIVE code refactor
7:56
You might not need useEffect() ...
21:45
Просмотров 149 тыс.
The Biggest Misconception of PROMISES vs OBSERVABLES
5:07