31e81947-5646-4259-9bc5-25bf7dc92e1b

1:22:59 8 वक्ता: 32 अध्यायः 2044 खण्डाः

अध्यायः

  1. 0:01

    So we'll do a quick recap here. This is the third day of Angular training. So we'll do a quick recap. Last week, we talked about ECMAScript. What are ECMAScript? Rules and guidelines for scripting language. Then we talked about Node .js. Wh…

  2. 1:02

    Now, today, What I'm going to do is we are going to talk about creating an Angular project. Let's understand a little bit about Angular first of all. Last time, we also talked about what is the importance of these frameworks. Why these fram…

  3. 2:15

    So let me just open the folder and here I'll be creating a Angular folder. Okay. So now we are going to. First of all, understand what is required for creating any Angular application. The first requirement for creating an Angular applicati…

  4. 5:22

    sorry. Slap. Okay. And you can run it globally as well or you can learn locally. So I'll just run it globally. Hyphen G. Enter. So, it will take a little time to get an install. Now, we are actually installing what? We are installing CLI. W…

  5. 10:26

    comma, and I'll add the bootstrap version. And the below version what you see here is are basically the dev dependencies. What is dev dependencies? Dev dependencies are those which you need it only for your local system. These are not requi…

  6. 11:36

    Clear? So npm install is going to install all these packages. But when you're building the application, the major packages which is required for your application to run are going to be in these dependencies. Clear? So I'm just writing the s…

  7. 14:49

    correct? But if you go and see the node modules, this is approximately around 250 MB of folder. If I check the size of the folder it is 250 MB and the file could be around 30 ,000 maybe approximate. I'm just giving you approximate value, 30…

  8. 19:50

    A component called as a app component. It is also picking some config from app .config. Let's go where is this file. file, app component, I press F12 here, I came into a file called as appComponent .ts. Now this class, this is a class, corr…

  9. 22:11

    a class. So, if I want to define a component, a very common definition of a component is, it's basically a combination of a class, a template, and metadata. It's a combination of a class, template and metadata. That means it's like a web pa…

  10. 24:00

    build, compile, build, spin -up, live development server. Okay. And also it will do which is bundling. Okay. All of this gets together happened just by writing this one command. Otherwise, I need to do that manually while writing build and …

  11. 28:40

    Okay. And there is one more file which is spec. Right now, just ignore this pack. This is for unit testing. So whenever you create a new component, this four files gets created automatically. And the second important thing what you'll see i…

  12. 29:42

    Click. I open one more terminal for me. I'll go to that folder where my project is there, myproj. Here, I went into my project. Now here, I'm going to write a command called ng, g for generate, c for component. understand a first component …

  13. 34:53

    And here, let's say I have an input type text box. Okay, now if I want to show that product name on the screen, what I'll do usually I'll just say product name, correct? Now, what is going to happen if I just write product name here? In the…

  14. 36:31

    Okay. Oh my bad That's strange. Okay, so so yes now it is going to print the product name Now, if I want to print the actual value of that product name property, I'll just put a square bracket here. This is called as a property binding. So …

  15. 40:22

    Now, what is happening here is guys, if you observe. I have the value printed in all the three sections, right? But what I want here is when I change the value here, it should actually reflect in my other code as well. Wherever that same pr…

  16. 42:59

    No issue with, I don't have to change any code here. I just have to change it with text area. Rest all remains the same. Because I am playing with what? I am playing with model. Is it clear? This is called as a two -way binding. So for two …

  17. 45:19

    Okay. And the value, the property binding, when you are actually playing with the attributes. Okay. So if you see, if I keep attributes as a value, it will usually bring as a string. For example, if you want to have a value called as a clas…

  18. 47:57

    Now, the next thing, what we are going to talk here is something called as a directives. Okay. What is directive? I'll be using a lot of different, different terms, guys. Directives. What is directives? Directives are nothing but changing o…

  19. 49:11

    In fact, this div will now get converted into a table as well. Possible. That could be possible. Directives are nothing but extend the power of existing element. It also changes the behavior, appearance, and behavior of HTML element. Certai…

  20. 54:09

    else block. Now what is this if block and else block? Okay, and you will get error for this as well. I'll tell you what is required. If block and else block. What are this? If block is nothing but it's like a template. So I wanted to render…

  21. 55:17

    Clear? Remember these things. Okay? And again, please, I would say, don't try to understand or try to remember the syntax. Syntax here is not important, guys. For syntax, you can always Google it. My only intention here is to understand wha…

  22. 56:45

    See, it's just printing the even and odd, but it is actually not showing and hiding. Guys, this is actually altering your DOM. You will see there is no section called as number is even anywhere in the code. But when I type here an even numb…

  23. 58:45

    and li. So what I'll do is, guys, just see, I'll just create a ul and I'm going to create li. Now this li, I want to repeat it how many times? Three times. So here I need to loop it, right? So here I'm going to apply something called as ng4…

  24. 1:02:05

    string, price, number. Let's have an implementation. Remember, we have done this. In implementation, what I'll do is I'll make this as an optional and I'll just check a condition that if product code or PID is not equal to undefined, then j…

  25. 1:05:33

    Okay. Let me give you a border here. T head. TR. which is going to have th. In here, I will be saying product ID. Then you will have product code, price, and product code, name, and price. Let's bind this. So t body, what is going to get re…

  26. 1:06:45

    spelling. Okay. That's it. And you will see a grid is there. And if I want to add any extra item in the grid, I can have a simple button and I can push that into the grid. So I'll just show you a simple example. Button. I'll say click event…

  27. 1:11:16

    Same way, I can apply one more, wherein I will say class .price. P1, if the condition is prod dot, price is greater than 500. And you can see the changes here. This syntax, if you observe here, I am using class dot and the name of the class…

  28. 1:12:29

    in this div, I wanted to have a div or maybe I wanted to have a italic tag which says that if ng, I'll apply ng if here and I'll say if my price is greater than 500, discount available. Sort of. You can see now. Did I wrote any code here? N…

  29. 1:14:16

    Hard code, I'll set it to red for now. Okay, so whenever I change the color of the drop, whenever I change this value on my drop down, automatically the selected color will get updated here. And you can print that value and see if you want …

  30. 1:16:09

    Till then, any questions here? Is everyone clear with the directives? Should I? I hope everyone is clear, right? Everyone is getting my what I'm trying to say here. See all these things you are going to apply it in one of the other places i…

  31. 1:19:41

    clear? Fine, so let's wrap it for today and we'll continue with creating our own custom directive and also we will look for pipes. So the next session would cover. Custom directive, my plan was to take it today, but again, sometimes it does…

  32. 1:22:03

    very, okay. Screen was not shared. Okay. Literally, that chat is not properly working. So that's why. Okay. So what I did is, guys, I just said, whatever we have covered till now, that was basically the different types of directives, right?…