Angular Tutorial - 10 - Template Reference Variables

  Рет қаралды 414,393

Codevolution

Codevolution

Күн бұрын

Пікірлер: 64
@anirudhadavalli8279
@anirudhadavalli8279 4 жыл бұрын
Vishwas, I started learning angular from your tutorials. I always refer to your tutorials whenever I need to brush up the concepts. Thanks for the tutorial they are very useful.
@sumeennaazshaik1214
@sumeennaazshaik1214 2 жыл бұрын
thanks man!! u made my work very easy .still toady in 2022 I found your tutorials are far better than latest version tutorials.
@sayakbanerjee9990
@sayakbanerjee9990 Жыл бұрын
If you get error saying : Parameter 'value' implicitly has an 'any' type. Use: logMessage(value: any){ console.log(value) }
@amirthak4743
@amirthak4743 Жыл бұрын
You helped me dood. Thanks!!
@timz2917
@timz2917 3 жыл бұрын
this guy has given me hope again
@tofgau
@tofgau 6 жыл бұрын
Vishwas, your videos are really great. Thanks a lot
@geodamian495
@geodamian495 6 жыл бұрын
Great tutorial series, geat job Vishwas!
@lokmanhosen4537
@lokmanhosen4537 6 жыл бұрын
Great tutorial and more great your explanation !!!
@MuhammadAhmad-rh3fm
@MuhammadAhmad-rh3fm Жыл бұрын
You made it look so easy. Thank you so much
@shubhammhatre4743
@shubhammhatre4743 3 жыл бұрын
don't know why but in upper version, in .ts file logMessage(value) was giving error, asking for provide type of value , so logMessage(value : any); worked for me
@ashwini02329
@ashwini02329 2 жыл бұрын
thnq bro... I was also stuck here !
@MuhammadUmar-gw8mv
@MuhammadUmar-gw8mv Жыл бұрын
Yes it did worked for me Thanks
@sanskratiagrawal4334
@sanskratiagrawal4334 4 жыл бұрын
Awesome explaination sir.
@pol-dev-v5y
@pol-dev-v5y 4 жыл бұрын
Thanks, great tutorial again! Your series are perfect.
@TheGhanashyam123
@TheGhanashyam123 5 жыл бұрын
great teaching skills and rapid. Great set of tutorials
@subramanyamchapala7362
@subramanyamchapala7362 5 жыл бұрын
thank you very much sir. your teaching is really understandable and full pledged.
@alimedani0296
@alimedani0296 4 жыл бұрын
Thank you sir, for these tutorials
@geomukkath5373
@geomukkath5373 3 жыл бұрын
I did the exact same thing but I got an error saying : Parameter 'value' implicitly has an 'any' type. So in my method definition I used the following : getValue(value: any){ console.log(value) } Now it works. I dont know why. Can someone enlighten me pls.
@arvindkumarrana2312
@arvindkumarrana2312 3 жыл бұрын
Because Typescript doesn't know what is the type of the value parameter that the getValue() method is getting. If you don't annotate some function argument, TypeScript assumes "any" and moves on. It is showing an error because if you look in the tsconfig.json file, 'strict' is set to true. It means strict type checking. In case you don't want to see such an error, you can set "noImplicitAny": false in the compilerOptions (in tsconfig.json) but that is not recommended because it is always useful to explicitly define the type of function arguments to avoid any issues. So since we have an input field that takes a text type value, I would suggest doing this - getValue(value: string){ console.log(value) }
@FeelGoodChronicles
@FeelGoodChronicles 3 жыл бұрын
Thanks man.....Its really helpfull
@nan6shny
@nan6shny 4 жыл бұрын
Thank you for this amazing series
@sonamohialdin3376
@sonamohialdin3376 2 жыл бұрын
So good tutorial thank you
@Lost1nTranslation
@Lost1nTranslation 3 жыл бұрын
Thank you!
@mohdmuzaffarahmed4923
@mohdmuzaffarahmed4923 4 жыл бұрын
Weel explained sir
@nitishtellakula7243
@nitishtellakula7243 2 жыл бұрын
Put value : any if ur getting an error : " parameter value implicitly has any type
@kotireddy419
@kotireddy419 4 жыл бұрын
Input variables can aslo access to ng model so why we used to template reference variable ?
@davinderkambojthind
@davinderkambojthind 4 жыл бұрын
Too good sir
@damandeepsingh2460
@damandeepsingh2460 4 жыл бұрын
Can we create a template reference variable dynamically? Like inside *ngFor can we create #1, #2 reference variable?
@mahendrashoor7641
@mahendrashoor7641 4 жыл бұрын
Great tutorials
@MrDunatis
@MrDunatis 6 жыл бұрын
is it not better to bind both text box and button, and use the values in the ts; instead of passing a reference variable? Because that way you have both values in the ts, which is better testable?
@shubhigupta6926
@shubhigupta6926 2 жыл бұрын
Error: src/app/test/test.component.ts:67:8 - error TS7006: Parameter 'value' implicitly has an 'any' type. 67 show(value){ getting this type of error in event binding, in angular tutorial 10. Plz tell me the solution.
@ghassenjemiai
@ghassenjemiai 2 жыл бұрын
change it to value:any
@piraviperumal2544
@piraviperumal2544 5 жыл бұрын
Great tutorials!!
@sanyamkarnawat
@sanyamkarnawat 2 жыл бұрын
Parameter 'a' implicitly has an 'any' type. got this error on passing value
@bugrae9341
@bugrae9341 3 жыл бұрын
Easy and awesome thanks a lot :)
@prinsyadavchukti9145
@prinsyadavchukti9145 3 жыл бұрын
How can we use the data of input textfield in all components.
@tejasd5578
@tejasd5578 3 жыл бұрын
Hii sir, how to print vishwas in webpage instead of console.
@sarahthomas8506
@sarahthomas8506 6 жыл бұрын
Hello i had a question, instead of using template reference variable , i have tried property binding with the "value" attribute of the input element with a class variable , and on button click i tried to log in the class variable, but it is not working. Could you please let me know where am i going wrong
@Codevolution
@Codevolution 6 жыл бұрын
You need to use two way binding and not just property binding
@sujithreddypatlolla2107
@sujithreddypatlolla2107 4 жыл бұрын
Hello codevolution I have a question what if have mutiple input fields still it works with each reference varaiable or any alternative?
@voalcalisticTanmay
@voalcalisticTanmay 4 жыл бұрын
If you multiple elements and you require refer to them then you need to have unique reference variable for each of them that's it. Hope this helps. :)
@Jai_Raj_007
@Jai_Raj_007 5 жыл бұрын
Superb👍
@GeniusFromPakistan
@GeniusFromPakistan 5 жыл бұрын
Btw this will not work if you use TemplateURL like people normally do this method will only work like what he is doing by calling function on the same TS page with Template on the same page
@harukogaki
@harukogaki 6 жыл бұрын
So template reference variables are another way of defining hrefs?
@nirajrewtani
@nirajrewtani 4 жыл бұрын
How to access multiple controls values
@Venkatasurendra476
@Venkatasurendra476 4 жыл бұрын
Hello sir instead of log into console i want to display on the browser what is the solution for this
@v.b.thorat1116
@v.b.thorat1116 4 жыл бұрын
document.write():
@sid99varma
@sid99varma 4 жыл бұрын
You can do something like this inside your handleInput method- handleLog(inp){ this.greeting=inp.value; } Now you have assigned the value to greeting which was initially an empty string to the value the user entered inside the input field!
@vishalsyoutube
@vishalsyoutube 4 жыл бұрын
Use interpolation: Declare a public variable in TS Class, public value1 = ""; Follow the syntax as is shown in the video But inside logMessage(value) method, add: this.value1 = value; And below the element, write {{value1}} It worked for me
@MZ-uv3sr
@MZ-uv3sr 3 жыл бұрын
One of the things I find confusing about Angular (and/or Typescript and Javascript) is all the symbols attached to names of things. # here. $ for observable. And why some variables end in !.
@jagi7976
@jagi7976 2 жыл бұрын
Every programming language/framework is going to have their own syntactical idiosyncrasies. It’s very similar to learning grammar in school: why is it mouse and mice and not house and hice? Why they’re their there? Why do loose and lose not sound similar, but cruise and lose do? Its random stuff like that that you just have to memorize to be able to speak fluently. It’s for every programming language, and I would say JS/TypeScript is one of the ones where their syntax makes the most sense
@rituphogat4950
@rituphogat4950 6 жыл бұрын
Can we access template reference variable without any event?
@indieNik
@indieNik 6 жыл бұрын
Good Question! To answer your question, Yes you can access the TRVs with the ViewChild decorator. Example: import {ViewChild, ElementRef} from '@angular/core'; @ViewChild('yourInputElement') yourInputRef: ElementRef; submit() { // Triggered on some other event console.log(this.yourInputRef.nativeElement.value); }
@kesavanarayana724
@kesavanarayana724 5 жыл бұрын
when you will make a angular project video?
@sablala3116
@sablala3116 4 жыл бұрын
which version is this 8 or 5
@ricko13
@ricko13 3 жыл бұрын
gud
@RahulSingh-ex2sm
@RahulSingh-ex2sm 5 жыл бұрын
Vishwas U r awesome! Nice content and Great Explanation throughout the series!
@jeganmuthu6962
@jeganmuthu6962 5 жыл бұрын
I am getting output as undefined, any one can plz help me out
@humayunimtiaz9605
@humayunimtiaz9605 4 жыл бұрын
the parameter of the method i.e "value" must be the same when you call the method i.e "input.value"
@abhilashkokkonda1713
@abhilashkokkonda1713 6 жыл бұрын
This is very similar to event binding.. Why again the same concept here in Angular?
@kidoo1567
@kidoo1567 8 ай бұрын
1:20
@SofianMW
@SofianMW 5 жыл бұрын
thank you!
Angular Tutorial - 11 - Two Way Binding
4:29
Codevolution
Рет қаралды 442 М.
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 2,3 МЛН
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 4,1 МЛН
Wait for it 😂
00:19
ILYA BORZOV
Рет қаралды 9 МЛН
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,2 МЛН
Angular Tutorial for Beginners: Learn Angular & TypeScript
2:02:42
Programming with Mosh
Рет қаралды 4,4 МЛН
Angular Tutorial - 15 - Component Interaction
9:33
Codevolution
Рет қаралды 561 М.
Angular Tutorial - 9 - Event Binding
5:19
Codevolution
Рет қаралды 482 М.
Angular Tutorial - 12 - ngIf Directive
7:09
Codevolution
Рет қаралды 445 М.
Java is ALWAYS Pass By Value. Here's Why
5:22
Coding with John
Рет қаралды 124 М.
Angular Tutorial - 6 - Property Binding
7:26
Codevolution
Рет қаралды 623 М.
NgTemplateOutlet in Angular - Everything You Have to Know (2022)
35:15
Decoded Frontend
Рет қаралды 52 М.
Next.js 15 Breakdown (Everything You Need To Know)
18:10
Web Dev Simplified
Рет қаралды 46 М.
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 2,3 МЛН