SlideShare a Scribd company logo
ngBoilerplate & 
generator-angular 
JS HCM Meetup – presented by Vincent De Smet
Why? 
• Yeoman - Stamp out a skeleton for your app quickly 
• Try: http://yeoman.io/codelab.html 
- very good intro! 
Uses generator-angular
Why ngBoilerplate? 
generator-angular 
• Package by layer 
• How to reuse? 
• How to debug? 
• Extensive sub-generators 
• Configuration options 
ngBoilerplate 
• Package by module 
• Lacks sub-generators 
• Lacks configuration options
Yeoman 
• Yo 
• Grunt / Gulp 
• Bower 
Get started: Install the ngBoilerplate generator globally: 
Using generator-ngbp.. Last updated on Aug, 28
Run generator of your choice
Use Bower package management 
• Uninstall what your project does not allow: 
• Install what your project requires: 
*i.e.: Foundation5+libsass instead of bootstrap+less 
**get sass as developer dependency only!
Manage dev dependencies with npm 
• Add grunt tasks with npm 
**grunt-sass is a SASS compiler using libsass instead of compass (ruby gem)
Customize your task runner (Grunt) 
• For example: to add sass compilation: 
1. Load the grunt-sass tasks: 
2. Configure the grunt tasks initConfig 
ngBoilerplate splits 
1. File Config 
(meta data for task config) 
2. Task Config 
& merges using lodash 
3. Register Alias Task, Multi Task for task running goodness - or create your own custom task
Customize your task runner (Grunt) - 2 
• In File config 
add sass info 
• In Task config 
configure grunt-sass task, 
multiple Task targets possible 
Templates are expanded recursively 
http://gruntjs.com/configuring-tasks#templates
Customize your task runner (Grunt) - 3 
• A task config can have multiple targets, 
if no target specified on run, all targets run 
• A task exposes default options for configuration. 
Options can be configured at different target level 
• Most grunt tasks are file operations (source > destination), 
declaration formats: 
1. Compact Format 
2. Files Object Format 
3. Files Array Format 
4. Older formats (won’t go into this)
Grunt File operations: Compact Format 
• ngBoilerplate example: 
Example: 
This concat task – build_css target 
1 source property ‘scr’ 
1 destination property ‘dest’ 
This format can only have 1 source-destination pair.
Grunt File operations: Files Object Format 
• ngBoilerplate example: 
Example: 
This sass task – dist target 
The property name ‘css/app.css’ is the destination 
The property value ‘scss/app.scss’ is the source 
This format can have multiple source – destination pairs
Grunt File operations: Files Array Notation 
• ngBoilerplate example: 
Example: 
This copy task – build_app_assets target 
Array of (src – dest) pairs +properties 
This format can have multiple source – destination pairs 
This format can also have additional properties per mapping
Grunt file: globbing patterns / +properties 
• http://gruntjs.com/configuring-tasks#globbing-patterns 
• http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
Registering Tasks 
• Alias Task 
• Multi Task 
Runs a plugin task taking into account the target, looks for configuration in 
config object. 
• Basic/Custom Task 
Example:
generator-ngbp – interesting bits: 
karmaconfig MultiTask : 
automatically updates the karma config file with all dependencies required to run tests: 
this.fileSrc http://gruntjs.com/api/inside-tasks#this.filessrc will contain all src files specified in the config object 
properties for the karmaconfig multi-task 
Grunt.file.copy http://gruntjs.com/api/grunt.file#grunt.file.copy with a processFunction to render the 
karma-unit.tpl.js template (expanding all vendor_files.js specified in the grunt config)
generator-ngbp – interesting bits: 
• Bower installed dependencies thus need to be added manually to:
Foundation5 / libsass tricky bits 
• Where to get Foundation5 SASS files? 
Get sass as developer dependency only! 
• Copy missing scss files from foundation libsass repo
Foundation5 / libsass tricky bits 
• _settings.scss partial still missing? 
• Get it from Foundation5 / Compass ruby gem generated directory.. 
• Update imports 
• Update gruntfile for Foundation5 sass files and replace recess task by 
sass task in: 
• concat:build_css 
• Index:build & index:compile 
• delta:sass 
• build & compile alias tasks
Grunt tricks 
• Could automatically load grunt tasks: 
https://github.com/sindresorhus/load-grunt-tasks 
• Better to use 
https://github.com/shootaroo/jit-grunt for Just In Time loading of grunt 
tasks 
• Use https://github.com/sindresorhus/time-grunt to see the benefits 
• https://github.com/tschaub/grunt-newer to run grunt with newer files only 
• https://github.com/sindresorhus/grunt-concurrent to run tasks 
concurrently 
• Split grunt configuration files http://creynders.github.io/load-grunt-configs 
• Have fun with github pages, https://github.com/tschaub/grunt-gh-pages
What’s next? 
• Learn Gulp! 
http://gulpjs.com/ 
Grunt is old… Gulp is all the rage now. 
• Write your own Generator… 
http://yeoman.io/authoring/
Generator explosion! 
• http://www.dancancro.com/comparison-of-angularjs-application-starters/
About me 
Author: Vincent De Smet 
this presentation source code: 
https://github.com/so0k/ngbp-foundation-libsass 
• Presentation prepared for Javascript Ho Chi Minh City Meetup Group 
You can find us at: 
• http://www.meetup.com/JavaScript-Ho-Chi-Minh-City/ 
• https://www.facebook.com/JavaScriptHCMC 
• https://plus.google.com/u/0/communities/116105314977285194967 
• http://www.slideshare.net/JavascriptMeetup
Ad

More Related Content

What's hot (20)

Built in ci-cd with kubernetes, jenkins and helm
Built in ci-cd with kubernetes, jenkins and helmBuilt in ci-cd with kubernetes, jenkins and helm
Built in ci-cd with kubernetes, jenkins and helm
Pau López
 
Docker multi-stage build
Docker multi-stage buildDocker multi-stage build
Docker multi-stage build
Alexei Ledenev
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
Danielle Madeley
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsWebinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Codefresh
 
Webinar: Using Docker Multi-stage Build to Create Advanced Pipelines
Webinar: Using Docker Multi-stage Build to Create Advanced PipelinesWebinar: Using Docker Multi-stage Build to Create Advanced Pipelines
Webinar: Using Docker Multi-stage Build to Create Advanced Pipelines
Codefresh
 
Deployment Automation with Docker
Deployment Automation with DockerDeployment Automation with Docker
Deployment Automation with Docker
Egor Pushkin
 
Auto-scaled Concourse CI on AWS w/o BOSH
Auto-scaled Concourse CI on AWS w/o BOSHAuto-scaled Concourse CI on AWS w/o BOSH
Auto-scaled Concourse CI on AWS w/o BOSH
佑介 九岡
 
Continuous Deployment with Jenkins on Kubernetes
Continuous Deployment with Jenkins on KubernetesContinuous Deployment with Jenkins on Kubernetes
Continuous Deployment with Jenkins on Kubernetes
Matt Baldwin
 
Testing strategies for Docker containers
Testing strategies for Docker containersTesting strategies for Docker containers
Testing strategies for Docker containers
Alexei Ledenev
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a proGitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a pro
sparkfabrik
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
Daegwon Kim
 
GDG Lima - Docker Compose
GDG Lima - Docker ComposeGDG Lima - Docker Compose
GDG Lima - Docker Compose
Mario IC
 
Webinar: Development Swarm Cluster with Docker Compose V3
Webinar: Development Swarm Cluster with Docker Compose V3Webinar: Development Swarm Cluster with Docker Compose V3
Webinar: Development Swarm Cluster with Docker Compose V3
Codefresh
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Kuan Yen Heng
 
Ruby microservices with Docker - Sergii Koba
Ruby microservices with Docker -  Sergii KobaRuby microservices with Docker -  Sergii Koba
Ruby microservices with Docker - Sergii Koba
Ruby Meditation
 
TIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containersTIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containers
The Incredible Automation Day
 
Development Swarm Cluster
Development Swarm ClusterDevelopment Swarm Cluster
Development Swarm Cluster
Alexei Ledenev
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Indrajit Poddar
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
Open Source Consulting
 
CI/CD with Kubernetes, Helm & Wercker (#madScalability)
CI/CD with Kubernetes, Helm & Wercker (#madScalability)CI/CD with Kubernetes, Helm & Wercker (#madScalability)
CI/CD with Kubernetes, Helm & Wercker (#madScalability)
Diacode
 
Built in ci-cd with kubernetes, jenkins and helm
Built in ci-cd with kubernetes, jenkins and helmBuilt in ci-cd with kubernetes, jenkins and helm
Built in ci-cd with kubernetes, jenkins and helm
Pau López
 
Docker multi-stage build
Docker multi-stage buildDocker multi-stage build
Docker multi-stage build
Alexei Ledenev
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
Danielle Madeley
 
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java AppsWebinar: Creating an Effective Docker Build Pipeline for Java Apps
Webinar: Creating an Effective Docker Build Pipeline for Java Apps
Codefresh
 
Webinar: Using Docker Multi-stage Build to Create Advanced Pipelines
Webinar: Using Docker Multi-stage Build to Create Advanced PipelinesWebinar: Using Docker Multi-stage Build to Create Advanced Pipelines
Webinar: Using Docker Multi-stage Build to Create Advanced Pipelines
Codefresh
 
Deployment Automation with Docker
Deployment Automation with DockerDeployment Automation with Docker
Deployment Automation with Docker
Egor Pushkin
 
Auto-scaled Concourse CI on AWS w/o BOSH
Auto-scaled Concourse CI on AWS w/o BOSHAuto-scaled Concourse CI on AWS w/o BOSH
Auto-scaled Concourse CI on AWS w/o BOSH
佑介 九岡
 
Continuous Deployment with Jenkins on Kubernetes
Continuous Deployment with Jenkins on KubernetesContinuous Deployment with Jenkins on Kubernetes
Continuous Deployment with Jenkins on Kubernetes
Matt Baldwin
 
Testing strategies for Docker containers
Testing strategies for Docker containersTesting strategies for Docker containers
Testing strategies for Docker containers
Alexei Ledenev
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a proGitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a pro
sparkfabrik
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
Daegwon Kim
 
GDG Lima - Docker Compose
GDG Lima - Docker ComposeGDG Lima - Docker Compose
GDG Lima - Docker Compose
Mario IC
 
Webinar: Development Swarm Cluster with Docker Compose V3
Webinar: Development Swarm Cluster with Docker Compose V3Webinar: Development Swarm Cluster with Docker Compose V3
Webinar: Development Swarm Cluster with Docker Compose V3
Codefresh
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Kuan Yen Heng
 
Ruby microservices with Docker - Sergii Koba
Ruby microservices with Docker -  Sergii KobaRuby microservices with Docker -  Sergii Koba
Ruby microservices with Docker - Sergii Koba
Ruby Meditation
 
TIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containersTIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containers
The Incredible Automation Day
 
Development Swarm Cluster
Development Swarm ClusterDevelopment Swarm Cluster
Development Swarm Cluster
Alexei Ledenev
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Indrajit Poddar
 
CI/CD with Kubernetes, Helm & Wercker (#madScalability)
CI/CD with Kubernetes, Helm & Wercker (#madScalability)CI/CD with Kubernetes, Helm & Wercker (#madScalability)
CI/CD with Kubernetes, Helm & Wercker (#madScalability)
Diacode
 

Similar to Angular boilerplate generator (20)

Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with Grunt
Ladies Who Code
 
Make JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and CleanMake JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and Clean
Blue Raster
 
Building JavaScript
Building JavaScriptBuilding JavaScript
Building JavaScript
Brady Clifford
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
Ryan Cuprak
 
Introduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme developmentIntroduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme development
James Bundey
 
Serverless containers … with source-to-image
Serverless containers  … with source-to-imageServerless containers  … with source-to-image
Serverless containers … with source-to-image
Josef Adersberger
 
Serverless Container with Source2Image
Serverless Container with Source2ImageServerless Container with Source2Image
Serverless Container with Source2Image
QAware GmbH
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overview
Kevin He
 
Multi modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.jsMulti modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.js
David Amend
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
NodeXperts
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
Pavan Kumar N
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
Oded Sagir
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)
Puppet
 
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Manuel Garcia
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
Arto Artnik
 
Docker Meetup Rosenheim: Package & deploy Microservices
Docker Meetup Rosenheim: Package & deploy MicroservicesDocker Meetup Rosenheim: Package & deploy Microservices
Docker Meetup Rosenheim: Package & deploy Microservices
Nico Meisenzahl
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
Riccardo Coppola
 
Leveraging Composer in Existing Projects
Leveraging Composer in Existing ProjectsLeveraging Composer in Existing Projects
Leveraging Composer in Existing Projects
Mark Niebergall
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
Spring boot
Spring bootSpring boot
Spring boot
Bhagwat Kumar
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with Grunt
Ladies Who Code
 
Make JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and CleanMake JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and Clean
Blue Raster
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
Ryan Cuprak
 
Introduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme developmentIntroduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme development
James Bundey
 
Serverless containers … with source-to-image
Serverless containers  … with source-to-imageServerless containers  … with source-to-image
Serverless containers … with source-to-image
Josef Adersberger
 
Serverless Container with Source2Image
Serverless Container with Source2ImageServerless Container with Source2Image
Serverless Container with Source2Image
QAware GmbH
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overview
Kevin He
 
Multi modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.jsMulti modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.js
David Amend
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
NodeXperts
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
Pavan Kumar N
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
Oded Sagir
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)
Puppet
 
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Manuel Garcia
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
Arto Artnik
 
Docker Meetup Rosenheim: Package & deploy Microservices
Docker Meetup Rosenheim: Package & deploy MicroservicesDocker Meetup Rosenheim: Package & deploy Microservices
Docker Meetup Rosenheim: Package & deploy Microservices
Nico Meisenzahl
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
Riccardo Coppola
 
Leveraging Composer in Existing Projects
Leveraging Composer in Existing ProjectsLeveraging Composer in Existing Projects
Leveraging Composer in Existing Projects
Mark Niebergall
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
Ad

Recently uploaded (20)

Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Ad

Angular boilerplate generator

  • 1. ngBoilerplate & generator-angular JS HCM Meetup – presented by Vincent De Smet
  • 2. Why? • Yeoman - Stamp out a skeleton for your app quickly • Try: http://yeoman.io/codelab.html - very good intro! Uses generator-angular
  • 3. Why ngBoilerplate? generator-angular • Package by layer • How to reuse? • How to debug? • Extensive sub-generators • Configuration options ngBoilerplate • Package by module • Lacks sub-generators • Lacks configuration options
  • 4. Yeoman • Yo • Grunt / Gulp • Bower Get started: Install the ngBoilerplate generator globally: Using generator-ngbp.. Last updated on Aug, 28
  • 5. Run generator of your choice
  • 6. Use Bower package management • Uninstall what your project does not allow: • Install what your project requires: *i.e.: Foundation5+libsass instead of bootstrap+less **get sass as developer dependency only!
  • 7. Manage dev dependencies with npm • Add grunt tasks with npm **grunt-sass is a SASS compiler using libsass instead of compass (ruby gem)
  • 8. Customize your task runner (Grunt) • For example: to add sass compilation: 1. Load the grunt-sass tasks: 2. Configure the grunt tasks initConfig ngBoilerplate splits 1. File Config (meta data for task config) 2. Task Config & merges using lodash 3. Register Alias Task, Multi Task for task running goodness - or create your own custom task
  • 9. Customize your task runner (Grunt) - 2 • In File config add sass info • In Task config configure grunt-sass task, multiple Task targets possible Templates are expanded recursively http://gruntjs.com/configuring-tasks#templates
  • 10. Customize your task runner (Grunt) - 3 • A task config can have multiple targets, if no target specified on run, all targets run • A task exposes default options for configuration. Options can be configured at different target level • Most grunt tasks are file operations (source > destination), declaration formats: 1. Compact Format 2. Files Object Format 3. Files Array Format 4. Older formats (won’t go into this)
  • 11. Grunt File operations: Compact Format • ngBoilerplate example: Example: This concat task – build_css target 1 source property ‘scr’ 1 destination property ‘dest’ This format can only have 1 source-destination pair.
  • 12. Grunt File operations: Files Object Format • ngBoilerplate example: Example: This sass task – dist target The property name ‘css/app.css’ is the destination The property value ‘scss/app.scss’ is the source This format can have multiple source – destination pairs
  • 13. Grunt File operations: Files Array Notation • ngBoilerplate example: Example: This copy task – build_app_assets target Array of (src – dest) pairs +properties This format can have multiple source – destination pairs This format can also have additional properties per mapping
  • 14. Grunt file: globbing patterns / +properties • http://gruntjs.com/configuring-tasks#globbing-patterns • http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
  • 15. Registering Tasks • Alias Task • Multi Task Runs a plugin task taking into account the target, looks for configuration in config object. • Basic/Custom Task Example:
  • 16. generator-ngbp – interesting bits: karmaconfig MultiTask : automatically updates the karma config file with all dependencies required to run tests: this.fileSrc http://gruntjs.com/api/inside-tasks#this.filessrc will contain all src files specified in the config object properties for the karmaconfig multi-task Grunt.file.copy http://gruntjs.com/api/grunt.file#grunt.file.copy with a processFunction to render the karma-unit.tpl.js template (expanding all vendor_files.js specified in the grunt config)
  • 17. generator-ngbp – interesting bits: • Bower installed dependencies thus need to be added manually to:
  • 18. Foundation5 / libsass tricky bits • Where to get Foundation5 SASS files? Get sass as developer dependency only! • Copy missing scss files from foundation libsass repo
  • 19. Foundation5 / libsass tricky bits • _settings.scss partial still missing? • Get it from Foundation5 / Compass ruby gem generated directory.. • Update imports • Update gruntfile for Foundation5 sass files and replace recess task by sass task in: • concat:build_css • Index:build & index:compile • delta:sass • build & compile alias tasks
  • 20. Grunt tricks • Could automatically load grunt tasks: https://github.com/sindresorhus/load-grunt-tasks • Better to use https://github.com/shootaroo/jit-grunt for Just In Time loading of grunt tasks • Use https://github.com/sindresorhus/time-grunt to see the benefits • https://github.com/tschaub/grunt-newer to run grunt with newer files only • https://github.com/sindresorhus/grunt-concurrent to run tasks concurrently • Split grunt configuration files http://creynders.github.io/load-grunt-configs • Have fun with github pages, https://github.com/tschaub/grunt-gh-pages
  • 21. What’s next? • Learn Gulp! http://gulpjs.com/ Grunt is old… Gulp is all the rage now. • Write your own Generator… http://yeoman.io/authoring/
  • 22. Generator explosion! • http://www.dancancro.com/comparison-of-angularjs-application-starters/
  • 23. About me Author: Vincent De Smet this presentation source code: https://github.com/so0k/ngbp-foundation-libsass • Presentation prepared for Javascript Ho Chi Minh City Meetup Group You can find us at: • http://www.meetup.com/JavaScript-Ho-Chi-Minh-City/ • https://www.facebook.com/JavaScriptHCMC • https://plus.google.com/u/0/communities/116105314977285194967 • http://www.slideshare.net/JavascriptMeetup

Editor's Notes

  • #2: I’m not affiliated with yeoman, bower, grunt, zurb/foundation5 and all images belong to these companies and were blatantly ripped from their website
  • #4: https://github.com/yeoman/generator-angular/issues/109 The organization by module was a requirement for the project – other generators / templates to consider: https://github.com/CleverStack/frontend-example-module/blob/master/module.js https://github.com/willogden/angular-acorn https://github.com/henyojess/generator-gulp-ng https://github.com/CleverStack/angular-seed https://github.com/pbojinov/generator-gulp-angular-less
  • #5: Yo sets up the skeleton, can conditionally generate Grunt & Bower configurations Grunt is a build system that can perform simple tasks similar to make/bundle/.. But extension modules provide a lot more powerful workflow. Grunt is heavily file based and goals are reached through task configuration. Since January 2014, Gulp has gained a lot of popularity due to it’s more intuitive stream oriented approach of tasks (without the need of intermediary files) However, Gulp & Grunt do not have to be exclusive: https://github.com/gratimax/gulp-grunt Bower is a package manager used for dependency management on the front end. (todo: better understand relationship between bower and browserify)
  • #6: https://github.com/thardy/generator-ngbp/commit/3f20f66c76781b978734c7500790edbe47060642
  • #10: See grunt tricks on automatically loading all tasks or loading JIT
  • #23: http://www.100percentjs.com/just-like-grunt-gulp-browserify-now/ https://github.com/yeoman/yeoman/issues/1232 https://www.npmjs.org/package/grunt-browserify-bower https://www.youtube.com/channel/UCm9iiIfgmVODUJxINecHQkA http://mindthecode.com/lets-build-an-angularjs-app-with-browserify-and-gulp/ http://mindthecode.com/writing-browserify-modules-for-your-angular-app/ Learn Browserify! http://browserify.org/articles.html
  • #24: There are simply too many generators to keep track off. Every few months a new technology appears and in my opinion it’s impossible to expect 1 generator that caters for all possible combinations. It’s a matter of finding the best tool for the job and mastering the tools you need.