TypeScript Tutorial #17 - Rendering an HTML Template

  Рет қаралды 96,028

Net Ninja

Net Ninja

Күн бұрын

Пікірлер: 32
@isurujn
@isurujn 2 жыл бұрын
This series has been fantastic. Short and concise with no BS, straight to the point lessons. I did something additional. Instead of having the `position` parameter of the render() method as string, I created an enum called ListTemplatePosition with two options as Start and End. Just to enforce the options available.
@vaneliot
@vaneliot 3 жыл бұрын
Hey Shaun! I came here for TypeScript syntax and I ended up brushing up on OOP concepts and how interfaces could work with rendering. I liked that you made a render() method and I love how all of these kinda look like React components. Thank you so much, Shaun!
@3xtraspicy
@3xtraspicy 4 жыл бұрын
This lesson has been extremely enlightening! Thank you mr. Net Ninja for all the amazing courses you do!
@hank91918
@hank91918 3 жыл бұрын
very. very slick lessons! Love how you brought everything together nicely at the end! Thanks Shaun!
@Shakeel714
@Shakeel714 3 жыл бұрын
Very helpful video series to learn TypeScript!! I am so excited to finally be able to learn TypeScript thanks to this tutorial series!
@thriftykapila8420
@thriftykapila8420 4 жыл бұрын
You are the best, just a little request. The Net Ninja, I hope you see this comment. Like me many other people want a web series based on building couple of web apps using complete MERN stack, as you had already covered everything like these in separate playlists dedicated to each technology. Kindly make a series for complete MERN stack web app. Also please teach Role based access control. and dashboard building... Lots of love, big time fan... Alright then Gang!
@madd5
@madd5 4 жыл бұрын
Thanks for these videos. It's really inspiring me to learn more.
@renarsdilevka6573
@renarsdilevka6573 2 жыл бұрын
I would recommend though to separate the domain/model data and formatting functionality. So it could be DocumentInterface which includes all the functionality and structure, and if you need to format then the concrete class can implement DocumentInterface and that can implement deeper HasFormatter (Formattable) interface. So that would mean Payment, Invoice would be documents and you can pass around DocumentInterface instead but it will have possible different extra functionality from other interfaces within. The other variant would be to have a Formatter which implements FormatterInterface and which does the formatting job only. You could pass then just a DocumentInterface, you would separate concerns then for sure. This code also works, but it mixes two concerns in the code, the main model and extra functionality we can do with it.
@MrKarthise
@MrKarthise 4 жыл бұрын
Quality explanation. Worth the time. Thank You The Net Ninja :)
@genxgamer777
@genxgamer777 Жыл бұрын
So far so good!
@VS257
@VS257 3 жыл бұрын
This is pure OOP!!!
@donmikele07
@donmikele07 Жыл бұрын
Great teacher, great tutorial(S), and a huge community! God bless you! BTW: I was playing arround and instead of doc = new Payment.... and doc = new Invoice, I typed: ``` let doc: HasFormatter; let className: typeof Invoice | typeof Payment = type.value === 'invoice' ? Invoice : Payment; doc = new className(toFrom.value, details.value, amount.valueAsNumber); ``` Is that correct in the TS context or I should have wrote it in the other way? It works but I'm not sure if it is correct implementation.
@chromebookacer7289
@chromebookacer7289 3 жыл бұрын
Question: the format() method is called in HasFormatter but defined in Payments and render() is defined in ListTemplate, right?
3 жыл бұрын
I can try to explain. On the HasFormatter Interface, He defined to return type (as a string) for function. On the Payments Class, He created a useful method and return a string value, because of format type is a string. Also same is defined for ListTemplate. Maybe you can watch again Type videos 😊
@francomacias8904
@francomacias8904 4 жыл бұрын
The Net Ninja is awesome!!!
@gururajmoger8649
@gururajmoger8649 4 жыл бұрын
Thanks 😊.. pls explain about to create services with crud operation without using any dependency like jQuery.. fetch method.. axios..
@VinceAggrippino
@VinceAggrippino 3 жыл бұрын
The reason VSCode didn't put `.js` on the end of the module name is because it doesn't belong there.
@muhayminkhan7063
@muhayminkhan7063 3 жыл бұрын
Hello everyone just a quick question. As a beginner I am following the same thing and it made successfully but I wanna store that data in local storage. so when I refresh the page the elements should remain their so I try to do this const ul = document.querySelector('ul')!; const itemStore = localStorage.setItem('element', ul.outerHTML); let List = new listElement(itemStore); But typescript is giving error on (ItemStore) ERROR: src/app.ts:17:28 - error TS2345: Argument of type 'void' is not assignable to parameter of type 'HTMLUListElement'. does anyone know how to solve this issue
@tomascarignano5002
@tomascarignano5002 2 жыл бұрын
Damnn I thought I would make tons of money by learning how to code, but now I see that doing some plumbing work I'll make about the same amount.
@komil.sobitov
@komil.sobitov 4 жыл бұрын
You can learn a lot of information from your video lessons
@ridl27
@ridl27 4 жыл бұрын
xD
@genisz2754
@genisz2754 2 жыл бұрын
Does anyone else has the following error in index.html? "Uncaught SyntaxError: Cannot use import statement outside a module (at app.js:1:1)" I searched in StackOvflow, and tried their solution, adding "type": "module", in package.json. But it doesn't solve the error.
@djpe4ka
@djpe4ka 3 жыл бұрын
Why we need interface HasFormatter? let doc: HasFormatter - it prevent's us from getting object properties, like doc.client. We know that we have those properties, but TS shows that "HasFormatter doesn't containt those properties". It is confusing and i think that in real projects we mostly want to get access to properties of object that we create. Another issue: if i write "let doc: Invoice|Payment", and "class Invoice implements HasFormatter" i actually can console.log(doc.client) and it works. Why? If our class implements HasFormatter, which, as we know, doesn't have any properties, only .format I will be glad if someone explain this to me.
@yannsalmon4074
@yannsalmon4074 4 жыл бұрын
I wondered, what's your color theme ?
@NetNinja
@NetNinja 4 жыл бұрын
Hey its Monokai++
@ridl27
@ridl27 4 жыл бұрын
ty.
@aneesasyed4906
@aneesasyed4906 3 жыл бұрын
Someone, please suggest to me the Best Latest Angular tutorials as The net Ninja aren't uploading. Similar to the teaching methodology like him.
@fredteixeira3604
@fredteixeira3604 Жыл бұрын
basic that's how React might work under the hood.
@danielwood2432
@danielwood2432 4 жыл бұрын
Great tutorial for Typescript, but not very SOLID.
@Elduque40
@Elduque40 4 жыл бұрын
Polymorphism is that you?
@fayking
@fayking Жыл бұрын
thank you
TypeScript Tutorial #18 - Generics
9:44
Net Ninja
Рет қаралды 120 М.
HTML Templates Instead Of Reactivity | Prime Reacts
12:42
ThePrimeTime
Рет қаралды 117 М.
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
TypeScript Tutorial #15 - Interfaces
7:19
Net Ninja
Рет қаралды 158 М.
HTMX & Go with ThePrimeagen | Preview
15:58
Frontend Masters
Рет қаралды 156 М.
as const: the most underrated TypeScript feature
5:38
Matt Pocock
Рет қаралды 128 М.
I bet you haven't heard of this cool HTML tag & trick!
8:51
FollowAndrew
Рет қаралды 9 М.
TypeScript Interfaces vs Types
13:59
Harry Wolff
Рет қаралды 89 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 915 М.
Learn TypeScript Generics In 13 Minutes
12:52
Web Dev Simplified
Рет қаралды 298 М.
Learn CSS Flexbox in 20 Minutes (Course)
20:37
Coding2GO
Рет қаралды 333 М.