![]() ![]() ![]() It takes the tag name as the first thing in a line, and the rest is the content that goes inside it. This template will create a p tag with the content Hello from Flavio.Īs you can see, Pug is quite special. As mentioned above, Jade is the old version of Pug - specifically Pug 1.0.Īlthough the last version of Jade is 3 years old (at the time of writing, summer 2018), it’s still the default in Express for backward compatibility reasons. You can still use Jade (aka Pug 1.0), but going forward it’s best to use Pug 2.0.Īlso see the differences between Jade and PugĮxpress uses Jade as the default. ![]() It’s Jade 2.0.ĭue to a trademark issue, the name was changed from Jade to Pug when the project released version 2 in 2016. Template engines allow us to add data to a view and generate HTML dynamically. What is Pug? It’s a template engine for server-side Node.js applications.Įxpress is capable of handling server-side template engines. Adding id and class attributes to elements.Setup Pug to be the template engine in Express.The route data property can contain an array of arbitrary string key-value pairs. This is done by using the Angular route data property of the route. We can configure the static data at the time of defining the route. In this article, we look at how to pass static or dynamic data using the Route. Angular can pass data through the route in several ways. We can also share data between components using the route. In case of components are unrelated then we can use the Angular Services to Share data between them. The parent can use the to access the child component. A child can pass data to the Parent using the & EventEmitter. The parent can communicate with their child using directive. Passing dynamic data (or object) exampleĪngular components can share data in many ways. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |