Haven't seen a better explanation of Decorators than this. Thanks.
@devilthemes4 жыл бұрын
your explanation is so much simple and every one can understand.
@Techsithtube4 жыл бұрын
Thanks for the comment.
@satyaprakashkumawat65756 жыл бұрын
Was watching a tutorial on udemy about angular and wanted to know the use cases of decorator. Now I am watching all the tutorials of this guy. Amazing explanation. Thanks
@atarazavi1332 жыл бұрын
Always the best place to understand complicated concepts... Thanks
@gilbertrosario86335 жыл бұрын
I am learning NestJS which is a Node.js framework that uses TypeScript decorators and I was at complete lost with the concept, but after watching this video I finally understand what decorators do. I may not know what the decorators of a given framework are doing under the hood but I least now I do know how they work. Thank you very much sir for this simple explanation for what it seems a complicated topic.
@Techsithtube5 жыл бұрын
Gilbert, when i first learnt Decorators i was very confused. So , I wanted to make it easier for everyone. thanks for watching.
@vijayswarnkar92395 жыл бұрын
I have gone through the complete series. Thanks for your efforts to make these complex concepts like home.
@fredpies5 жыл бұрын
really to the point.. decorators are something like syntactic sugars for property descriptor filter functions
@georgesaeid72314 жыл бұрын
This is the best out there in explaining decorators. Thank you.
@RobertHieger6 жыл бұрын
Thank you for providing such an elucidating video tutorial. I must admit that I am still a bit foggy on decorators because I have not been made aware of the undergirding principle of prototype inheritance that you touch on. I will have to get back to this. But as I am now in a bootcamp program with Woz U and we are studying Angular, your video has proven of help. I look forward to viewing your other tutorials.
@FredoCorleone6 жыл бұрын
Shorten getColor() with get color() then you can access the method like a property instanceCar.color. Anyway this indian guy is the best on teaching things, straight to the point.
@tekbal4 жыл бұрын
Awesome explanation. Quite didactic. The girl with lipstick example is on point. Although my brain exploded a bit on the part where you decorated the property of the class to change the descriptor.
@Techsithtube4 жыл бұрын
Glad it was helpful! :)
@nafeesahmed49427 жыл бұрын
Great explanation, please also include some tutorials regarding functional programming( map,reduce,filter). there are many tutorials but your explanation way is very nice.
@elfpimp17 жыл бұрын
Nafees abbasi I thought he had those. I'd like to see them if he doesn't.
@andreascarpa71435 жыл бұрын
Very clear, I've really appreciated. Thank you so much
@hayatasuenaga70283 жыл бұрын
I always appreciate your easy explanations!
@sudharsan.ravikumar6 жыл бұрын
Great, I understood 100% of the content in this video, Every detail was useful.
@akashpal96917 жыл бұрын
My js knowledge has tremendously improved from your channel, hoping for angular 4 tutorials soon.
@Techsithtube7 жыл бұрын
I am glad that it helped. I will start angular tutorials from next weeks. Thanks for watching!
@guidingpanda7 жыл бұрын
I really appreciate this tutorial, for this has made Angular code reading/understanding really simple!!
@Techsithtube7 жыл бұрын
Yes its very important to understand decorators before starting angular ! Thanks for watching! :)
@RahulSingh-ex2sm5 жыл бұрын
Great way of explaining this complex concept! Thanks!
@Techsithtube5 жыл бұрын
This one was hard to explain . but there is always a way. :)
@RahulSingh-ex2sm5 жыл бұрын
@@Techsithtube when I tried the same code it gave error why??. It want me to declare lips as static variable bcz we r accessing this with class name directly . error were: 1>Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option `to remove this warning. when i resolved it by configuring "tsconfig" it showed me the error i.e " lips not declared! " then i resolved it by declaring a variable which is static! and it worked.. But why it didn't worked as i copied paste ur code ??
@Techsithtube5 жыл бұрын
Decorators are not in JavaScript yet. they are being considered. However they are part of TypeScript spec. that is why you had to add that line.
@armarcorry33725 жыл бұрын
Thank for these tuts, you are a very good teacher.
@buncha14995 жыл бұрын
Thank you Techsith I always enjoy learning from you
@nabiisakhanov35224 жыл бұрын
10/10 man best explanation
@Techsithtube4 жыл бұрын
Thanks for watching..
@arthur8888ab3 жыл бұрын
Thank you for the clear explanation.
@pouyajabbarisani4 жыл бұрын
Is was simple, useful and straight forward. thank you, man!
@sourabhmunjal38302 жыл бұрын
Good work, Addy Osmani
@100krishna1007 жыл бұрын
Thanks for the tutorial. @8.57 => I believe the program is not throwing an error because the code might not be in strict mode. 'use strict' will throw an error if we try to update a non-writable property or method.
@srinumajji5016 жыл бұрын
Nice tutorial Gurujiii, Thanks for sharing these kind of tutorials to us
@phplaw6 жыл бұрын
I really love your video, easy to understand, hope you keep your love on making video. Thanks
@MrMarkgyuro5 жыл бұрын
thank you! easy to get the idea with your explanation :)
@TottiBln5 жыл бұрын
Best explanation, ever!!! Thank you!!!
@betelhemtesfaye78382 жыл бұрын
Thank you Sir! It really helps.
@horizoncoding_6 жыл бұрын
earrings and lipstick, thanks, it's fare more original and grabbing than foo / bar, thanks for the tutorial
@naj41635 жыл бұрын
Good explanation, thanks
@MohamedShedo4 жыл бұрын
it's really cool man. you 're awesome
@AbhishekNigam5 жыл бұрын
Lucid explanation!
@shyam123m5 жыл бұрын
Super. Very useful. Thanks Sir.
@paulinasurazynska85164 жыл бұрын
super well explained, thank you so much! :)))
@RajeshWellington7 жыл бұрын
Can you do a video for 'async' and 'await'?
@vigneshbalachandran97046 жыл бұрын
He already did
@anaghasalvi83644 жыл бұрын
Thank you so much
@Techsithtube4 жыл бұрын
You're most welcome
@jamalguyo46357 жыл бұрын
your tutorials are amazing. watched almost all your playlist. can you create one with how to create javascript library like jquery from scratch. will really appreciate
@Techsithtube7 жыл бұрын
Sure i think that is a great idea. I will create on soon .Thanks for watching!
@Valsenasd5 жыл бұрын
Man, you are awesome
@seenuvasanv6 жыл бұрын
yes, it is much simpler. thanks.
@siddhivinayaka31415 жыл бұрын
@techsith, firstly nice tutorial. Wanted to know. What exactly different between mixins and decorators? Mixins: Additional functionality of multiple objects and given as separate one object. Decorators: Also modifies the object instance directly. Can you clarify on this? Thanks in advance.
@hugofilipeseleiro5 жыл бұрын
Thanks man !!
@itsrahimuddinkhan7 жыл бұрын
Nice explanation. Please provide lessons on Angularjs 2.0
@Techsithtube7 жыл бұрын
That is my next plan. I am working on it right now.
@itsrahimuddinkhan7 жыл бұрын
techsith Thank you
@ManOnHorizon5 жыл бұрын
Thank you for this series, but there is no class mixins tutorial: neigher in the playlist nor on the channel. Are there some plans to produce that one or is there some kind of a problem? Thank you one more time)
@nikhilkulkarni25566 жыл бұрын
I did not understand the purpose of "$" in the program @5:34
@free3style7875 жыл бұрын
It's the ES6 template literal syntax: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals.
@dmitryscherba57582 жыл бұрын
I've watched the vid several times and I still have questions: like how and when the decorator function is called? How does readonly decorator accept the 3 arguments? I assume it takes the method as a target, but where does it get the key and descriptor? Does it call Object.defineProperty under the hood?
@dayanromo5 жыл бұрын
Excellent!
@elfpimp17 жыл бұрын
So, when I first started at Codefellows here in Seattle around March timeframe, they had us using Atom for editing, for this latest course, "full stack Javascript " the instructor has us using VS code. I was wondering if you could do a vid maybe comparing, pros and cons, ease of learning, etc...
@Techsithtube7 жыл бұрын
Sure I think that would be a good topic. I have used both so I can do a good comparison. Thanks for watching! :)
@elfpimp17 жыл бұрын
techsith that's groovy! Just don't stretch yourself too much. I saw a vid on YTs compensation model and honestly, I feel for content creators who are trying to do YT full time.
@meetshujah6 жыл бұрын
you nailed it Allah bless you.
@gopikirshnasathyamurthy49686 жыл бұрын
I think you have to have 'use strict' if you want to see error when overriding an immutable value
@yassine_klilich5 жыл бұрын
great explanation (y) (y)
@sabareeshk9767 жыл бұрын
Thanks for the tutorial
@Techsithtube7 жыл бұрын
Thanks for watching!
@gabrielfono8444 жыл бұрын
clean
@RajeshWellington7 жыл бұрын
What do you think about React License patents?
@Techsithtube7 жыл бұрын
I don't like it. I think it's not nice to people who are using it thinking that its free. I would say move to either ember or vue. which are not supported by big corporations. WHat do you think?
@RajeshWellington7 жыл бұрын
I think they took a big step moving from BSD + Patents to MIT license, Even though they aren't much difference. We should stick to React because MIT-licensed projects can be used/redistributed in BSD-licensed projects (but unless there are modifications, the users can get it from the original sources also. BSD-licensed projects can be used/redistributed in MIT-licensed projects. MIT license allows for distribution without contribution credits; BSD doesn't. So this major change makes sense right??. We can fall in love with React more and more.
@Techsithtube7 жыл бұрын
As a developer it wont make much difference. Its only for a company when you have to deal with FOSS and licensing. There are some legal situations that can create problems. But I guess they will have to figure it out.
@mdnaembhuiyan30734 жыл бұрын
please make a tutorial on typeScript
@Techsithtube4 жыл бұрын
Will do , thanks for watching!
@eugenekhristo72526 жыл бұрын
10:22 - return descriptor; is not necessary
@moneyharry4 жыл бұрын
yes, it isn't.
@shujaatali84146 жыл бұрын
you are guru, keep it up (Y)
@michaelerwin87446 жыл бұрын
So does it mean whenever a decorator @readonly is used in a function or class it automatically receives all the object parameters (target, key, description)?
@Techsithtube6 жыл бұрын
Yep. basically it decorates ( adds ) those properties to the class
@sergioangel83625 жыл бұрын
@techsith sorry still not clear. In this example readOnly takes target, name, descriptor. But you don't pass anything into readOnly when you place it on top of getColor. So does this mean the decorator looks for 'this' to pass in 'target' and what ever is underneath it will be passed in as 'name'? And where does it get the value of descriptor? Sorry hope my question makes sense.
@federicoperalta92455 жыл бұрын
@@sergioangel8362 We are two now. Still not clear.
@naruto54376 жыл бұрын
loved it
@maskman48217 жыл бұрын
cool, though I don't quite understand it, I have some idea and the concept is clear, it would be better to explain through an actual example like a game or the one you used in angular.
@Techsithtube7 жыл бұрын
I am building a series on angular 4 . so soon you will see decorators in a practical application
@maskman48217 жыл бұрын
thanks so much for the reply, seems decoration is a must know topic.....
@johnb13917 жыл бұрын
Hi Stephen. So the basic idea behind the Decorator pattern is that you can easily attach additional things to an item. There is a Github repo (written in Java, NOT JavaScript) called "Starbuzz" that showcases how to use Decorator pattern for making a Point of Sale (POS) application for a coffee shop. Read below for further example for the principle behind Decorator design pattern: When you order a cup of coffee at a coffee shop, there are many different versions of coffee that you can get. Let's ignore different coffee blends for the moment. You could get "black coffee", which is just plain coffee with no milk added or sweeteners like syrups. But maybe plain coffee is too bitter for you so you want some milk. Maybe for our coffee shop we charge 50 cents ($0.50) for added milk. Maybe you also want sweet coffee that has hazelnut flavour but that also costs more money (let us say 25 cents or $0.25). We have cost of coffee by itself. We will say it is $1.00. With Decorator pattern, we set up the application so that we can easily add on these additional items to add on to the price. So instead of writing MANY different classes all for different types of coffee (Coffee class, CoffeeWithMilk class, CoffeeWithMilkAndHazelnutSyrup class, etc), we can instead easily attach these additional items (in Java via "interfaces") to our main class, Coffee. Now we get the same performance benefit we would get from writing all those different permutations of possible classes but without writing too much extra code. This is the main idea behind Decorator class. Hope it helps! Unfortunately I cannot find many examples of Starbuzz example like specified above with JavaScript (only with Java, COMPLETELY different programming language!). But I hope this helps explain the idea behind the design pattern and what it is used for. When we want to add things to one original main thing, Decorator pattern helps us build that customization without adding on too many additional subclasses/functions/etc.
@maskman48217 жыл бұрын
thank you so much for the detailed explanations!!!
@Techsithtube7 жыл бұрын
thanks John this is good info.
@nikhilkulkarni25566 жыл бұрын
I did not understand the purpose of "$" in the program @5:34 "$" is used in regular expression in javascript. Have you used jquery or angular js
@Techsithtube6 жыл бұрын
the $ here is actually template string. for more details look at this video kzbin.info/www/bejne/q3TGqX6mlK2Vgc0
@nikhilkulkarni25566 жыл бұрын
I will watch the video of template string and will get back to you.Thank you for quick reply
@cyrusbfbulan65737 жыл бұрын
sir..please need your help.. i know its out of topic my Sublime IDE accidentally i got a mistake in pressing hide the Tool Menu.. i cant work/practice please anyone help me i am a new in this world please..
@Techsithtube7 жыл бұрын
Are you talking about the tool drop down menu? on Windows ctrl+shift+p followed by 'vmen' (short for View Menu)
@believelody55316 жыл бұрын
What will happen if we do: redCar.color = "blue" and console.log it?
@Techsithtube6 жыл бұрын
JavaScript all properties are public so you will be able to do console.log( redCar.color) and it will give you blue.
@ellsonmds53104 жыл бұрын
let log=console.log; ///Decorator ///currying ///give the color let lipstick = function(color){ //pass in the target return function(target){ //extend/decorate the target target.lips=color; ///if we want to chain methods, return the target return target; } }; //target object let girl={ info:function(){ log('I have '+this.lips + ' lips!'); } }; ///Usage lipstick('red')(girl).info();
@Techsithtube4 жыл бұрын
Thanks for sharing :)
@Oswee5 жыл бұрын
Kinda great video, but.... it does not "click". More practical "Where and Why" would be great.
@creative-commons-videos4 жыл бұрын
but sometime decorators can do damage as well :)
@mariumgoraya43635 жыл бұрын
Thanks for such a nice video sir, but i have a question. By applying @decorator on classes and on methods of the class , all objects of that class will have same behavior, but i have read that decorators can change the behavior of individual objects dynamically with out affecting the other objects of that class. will you please elaborate how we can achieve this in javascript
@j.almadhaji6 жыл бұрын
so confusing can you make a module tutorial video thanks
@Techsithtube6 жыл бұрын
Here is a video on JavaScript modules kzbin.info/www/bejne/fqKsnJeagct2d80
@hmalintsyan63604 жыл бұрын
I really want to understand decorators but nothing works , and i get very upset((((
@Techsithtube4 жыл бұрын
I am assuming you are referring to Angular Decorators. Decorators are complicated. Hope you get some understanding of how it works from this video.
@ronidey3806 жыл бұрын
Sir why do you crop your videos too much?? It breaks the rhythm
@Techsithtube6 жыл бұрын
Sorry about that , in newer videos i do that less .
@kalleneumann2034 жыл бұрын
I like your tuorials better when you keep them unopinionated about role models :/
@shyama56124 жыл бұрын
The dislikes are probably from those who clicked looking at the girl pic with the lipstick
@Techsithtube4 жыл бұрын
Shyam, in my expreience, people always are going to dislike, :)