1
00:00:06,890 --> 00:00:08,180
In this video.

2
00:00:08,180 --> 00:00:10,960
Let's talk about templates.

3
00:00:11,010 --> 00:00:11,960
Engine.

4
00:00:12,410 --> 00:00:17,030
What does it mean and why do we need template engine?

5
00:00:17,330 --> 00:00:20,690
We are still under seven static files.

6
00:00:20,870 --> 00:00:29,420
In the previous video we talk about how we can serve a HTML template and you can see that everything

7
00:00:29,420 --> 00:00:30,710
works fine.

8
00:00:30,830 --> 00:00:39,320
We're able to make a post request from the client side using a form and send a data to the back end.

9
00:00:39,710 --> 00:00:49,520
But one caveat thing about the HTML templates was that if we are trying to send data from the back end

10
00:00:49,520 --> 00:00:54,380
and display into the browser, we need a lot of work to do.

11
00:00:54,860 --> 00:00:59,990
That is, we need to create a JavaScript file inside the client side.

12
00:01:00,020 --> 00:01:08,150
Then the file will make a request to the back end and after fetching the data we are going to inject

13
00:01:08,150 --> 00:01:09,950
the data into the DOM.

14
00:01:10,070 --> 00:01:12,320
So it's going to be double work.

15
00:01:12,560 --> 00:01:18,080
That is why templates engine comes into play with template engines.

16
00:01:18,080 --> 00:01:27,380
We are not going to deal with the DOM, but instead we are going to write JavaScript inside the HTML.

17
00:01:27,560 --> 00:01:30,440
So what is template engine?

18
00:01:30,440 --> 00:01:41,000
Well, template engine is a way of allowing us to write JavaScript inside a HTML template and we can

19
00:01:41,000 --> 00:01:49,250
pass dynamic data from the back end and display it inside the HTML template.

20
00:01:49,250 --> 00:01:52,280
And this one going to make our life easier.

21
00:01:52,610 --> 00:02:00,140
So after we've gone through this section, we are going to create real world application where the front

22
00:02:00,140 --> 00:02:07,490
end will talk to the back end and back end can talk to the front end and vice versa in easiest way.

23
00:02:07,520 --> 00:02:13,310
So what kind of template engines are we going to use for template engines?

24
00:02:13,310 --> 00:02:15,500
We have couple of them.

25
00:02:15,500 --> 00:02:22,040
So I guess you may be thinking, are we going to learn a new way of writing a HTML?

26
00:02:22,250 --> 00:02:24,470
The answer is no.

27
00:02:24,890 --> 00:02:32,690
We are still going to write a HTML code, but you are going to add additional ingredients into it.

28
00:02:32,960 --> 00:02:37,580
So template engines are advance of HTML.

29
00:02:37,880 --> 00:02:41,510
So for template engine, we have couple of them.

30
00:02:41,510 --> 00:02:43,910
Let's see a few of them.

31
00:02:44,330 --> 00:02:51,620
The first one is what we call my touch and the other one is what we call pack.

32
00:02:51,620 --> 00:02:57,470
So if you look at the syntax pack is not equally as HTML.

33
00:02:57,470 --> 00:03:07,760
So what we are going to use is called e, g, s and e j as is the easiest way because it follows the

34
00:03:07,760 --> 00:03:10,910
same syntax as raw html.

35
00:03:11,420 --> 00:03:20,930
So it describes edges with one line of sentence simply means embedded JavaScript templating meaning

36
00:03:20,960 --> 00:03:24,470
writing JavaScript inside a HTML.

37
00:03:24,680 --> 00:03:32,990
After we cover this section, then we can begin to create web word applications in the next video.

38
00:03:32,990 --> 00:03:37,130
Let's set up our server to get started with e.g. s.

