![]() This is in spite of many more efficient options such as Pug, Slim, HAML among others being in existence. However, when it comes to templates, only two options are available: HTML and SVG. Components provide an amazing means to structure views, facilitate code reusability, interpolation, data binding, and other business logic for views.Īngular CLI supports multiple built-in CSS preprocessor options for component styling like Sass/SCSS, LESS, and Stylus. ![]() In this article, Zara Cooper explains what Pug is and how you can use it in your Angular app.Īs a developer, I appreciate how Angular apps are structured and the many options the Angular CLI makes available to configure them. In Angular, you can use Pug to write component templates and improve a project’s development workflow. Leave a comment below, and I'd be glad to answer your questions and comments.Pug is a template engine that allows you to write cleaner templates with less repetition. I'd love to hear from you, and see how you implemented Pug in your projects. You can come back to it anytime you need a specific syntax, especially for the more complex elements. If you just want to manually convert a Pug template to HTML, I found this online converter that did an amazing job for me, and it will certainly make it for you too.įinally, if you need a quick overview of the most common Pug syntaxes, check this cheat sheet. It has very straightforward steps about the setup and integration. You can make more use of it by including other pug files, creating complex layouts, or even including markdown files.Īdding Pug to your projects is very easy, just follow the official documentation. Now you are ready to enable your Pug templating engine! With the for loop I could add 36 sparks rotated by 10 degrees each, and with a random delay in their animation, that - combined with CSS - resulted in this: ![]() I used this trick in almost all items, often combined with more complex parameters: ![]() This will create 10 elements inside the sky. Enter fullscreen mode Exit fullscreen mode ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |