SlideShare a Scribd company logo
Angular ❤ CMS
a journey in dynamic content with @filipbech
@IMPACTdigitaldk
Filip
@filipbech
"
https://developers.google.com/experts/people/filip-bruun-bech-larsen
#commerceExperience #weAreHiring #denmark #lisbon
…enough about me
let’s talk about using Angular with a CMS!
Angular ❤ CMS
a journey in dynamic content with @filipbech
@IMPACTdigitaldk
Let’s do like angular 1
NOPE
need to bootstrap a component
Angular ❤️ CMS from #AngularUp
…but we have no root
component?
Bootstrapping multiple
components
• its a little harder to maintain state between applications
(but possible)
• the cms now needs to know what components are
angular-components, so they can all be bootstrapped.
(and their DOM-nodes if multiple of the same
component)
Angular ❤️ CMS from #AngularUp
Initial data and content
Angular ❤️ CMS from #AngularUp
NOPE
Because
• Root-components cannot have inputs
• Root-components cannot use content-projection
(transclusion)
https://github.com/angular/angular/issues/1858
How about a <body>-
component then?
Angular ❤️ CMS from #AngularUp
Eeeewwwww
• even though it works - it feels terrible and wrong!
• and we need the parser at runtime
• so no AOT and bad perf
Elements
Angular ❤️ CMS from #AngularUp
still no animated 

page-transitions…
We need a SPA
Single Page Application
• so we can also share state between routes
• animate route-changes
• and much more…
Demo-time
to heighten the suspense…
Angular ❤️ CMS from #AngularUp
It starts with a router
Angular ❤️ CMS from #AngularUp
…thats not very dynamic
We have too many routes with
no patterns
• “/“ is a frontpage
• “/om/os” is a content-page
• “/mejeri“ is a category-page
• “/mejeri/ost“ is a sub-category-page
• “/ost-i-skiver-mild-13-cheasy-200-g” is a product-page
So I talked to the Angular team…
…let the CMS
output route-config
Two issues with that approach
• Need to build and invalidate the bundle’s cache every
time an editor makes a change
• Users get stuck on the route-config they get at first load
One route to rule them all
Angular ❤️ CMS from #AngularUp
Angular ❤️ CMS from #AngularUp
Get the data in a resolve
Angular ❤️ CMS from #AngularUp
PageResolve is just a class with resolve(route)-method on it
In angularJS we could use templateFactory and
select a template based on the api-response
But we cannot do that in Angular (2+), because 

there is no template-parser at runtime
All possible
PageComponents with
individual *ngIf’s
Angular ❤️ CMS from #AngularUp
Eeeewwwww
Even though all the *ngIfs in the template are AOT
compiled into something more acceptable…
It still seems wrong to have it in the template!
but (for now) it works…
until you navigate around

(nothing happens)
you’re not changing the route
just its options
(so: no new resolve, no new ngOnInit)
Refactoring
• Listen for route-changes and handle resolving data
manually
Angular ❤️ CMS from #AngularUp
The problem cascades
• When we go from one product-detail-page to another
product-detail-page…
• Refactor init-logic into ngOnChanges
Then came rc4
ComponentFactoryResolver adds beauty
and power to generic components…
Angular ❤️ CMS from #AngularUp
What components
are available?
Angular ❤️ CMS from #AngularUp
Angular ❤️ CMS from #AngularUp
Angular ❤️ CMS from #AngularUp
we still can’t animate
page-transitions
cause its really not…
Custom
RouterReuseStrategy
Angular ❤️ CMS from #AngularUp
Angular ❤️ CMS from #AngularUp
We have animations…
woohooooo
What about Rich-text
content from the CMS?
Angular ❤️ CMS from #AngularUp
Angular ❤️ CMS from #AngularUp
ng-bind-html
Angular ❤️ CMS from #AngularUp
Perfect, except for links
the router doesn’t “hijack”
a[href]-clicks like uiRouter
enter the [href] directive
NOPE
@Hostlistener =>
router.go()
* in reality it’s a little more complicated…
Sweeeet
all we ever wanted
Without all the ugly
Flexibility
real routes => getting data in resolve + animations
Rich Text
Same approach for the
dynamic content spots
* we add another directive so we can repeat via *ngForOf
AOT
#justWorks
Server Side Rendering
SEO, social previews and 

faster perceived load-times
Seems hard to wrap your
head around universal
The idea
• server.module and a client.module
• they both import the app.module
• server and client module then replaces the
dependencies that are different with appropriate
environment-versions (eg. xhr or node-fetch, DOM or
virtual-dom)
• the cli can pretty much do it for you
Angular ❤️ CMS from #AngularUp
Can’t touch this (the DOM)
(no direct window, querySelector, localstorage)
Maintaining state
we want to maintain state, so we don’t re-do all fetches
and calculations when the client boots up
StateTransfer Service
@angular/platform-server
CACHING OF SSR
can’t work with personalisation
3 strategies
at client
bootstrap
at 1st user
interaction
no SSR
enter no-ssr directive
Angular ❤️ CMS from #AngularUp
Angular ❤️ CMS from #AngularUp
We made it
Packaged up on npm as
@impactdk/ngx-routing-utils
Thank you, this was:
“Angular ❤ CMS”
I’m @filipbech
@IMPACTdigitaldk
@impactdk/ngx-routing-utils
Code-snippets made with carbon
Angular ❤️ CMS from #AngularUp

More Related Content

What's hot (20)

Fast Web Applications with Go
Fast Web Applications with Go
Eylem Ozekin
 
Why use Go for web development?
Why use Go for web development?
Weng Wei
 
Developing webapp using Polymer : is it ready for production? or not?
Developing webapp using Polymer : is it ready for production? or not?
Jeongkyu Shin
 
Getting started with Angular CLI
Getting started with Angular CLI
Sasha Vinčić
 
Frontend as a first class citizen
Frontend as a first class citizen
Marcin Grzywaczewski
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)
Devin Abbott
 
The Thick Front-End
The Thick Front-End
Jeff Dickey
 
State of angular ecosystem
State of angular ecosystem
Giovanni Cândido da Silva
 
Introduction to koyomi #appkoyomi
Introduction to koyomi #appkoyomi
IKEDA Kiyoshi
 
Rails Vs CakePHP
Rails Vs CakePHP
Gautam Rege
 
FuelPHP presentation - PeoplePerHour workshop
FuelPHP presentation - PeoplePerHour workshop
Fotis Alexandrou
 
FuelPHP
FuelPHP
Nitin Reddy Katkam
 
Python to go
Python to go
Weng Wei
 
Diving into SngularJS
Diving into SngularJS
francisspor
 
The Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cli
Tracy Lee
 
FuelPHP - a PHP HMVC Framework by silicongulf.com
FuelPHP - a PHP HMVC Framework by silicongulf.com
Christopher Cubos
 
Salvatore Laisa - Da Angular a React - Un viaggio inaspettato
Salvatore Laisa - Da Angular a React - Un viaggio inaspettato
Codemotion
 
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
Matteo Manchi
 
Back to the ng2 Future
Back to the ng2 Future
Jeremy Likness
 
So you think you can scale
So you think you can scale
Dan Beil
 
Fast Web Applications with Go
Fast Web Applications with Go
Eylem Ozekin
 
Why use Go for web development?
Why use Go for web development?
Weng Wei
 
Developing webapp using Polymer : is it ready for production? or not?
Developing webapp using Polymer : is it ready for production? or not?
Jeongkyu Shin
 
Getting started with Angular CLI
Getting started with Angular CLI
Sasha Vinčić
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)
Devin Abbott
 
The Thick Front-End
The Thick Front-End
Jeff Dickey
 
Introduction to koyomi #appkoyomi
Introduction to koyomi #appkoyomi
IKEDA Kiyoshi
 
Rails Vs CakePHP
Rails Vs CakePHP
Gautam Rege
 
FuelPHP presentation - PeoplePerHour workshop
FuelPHP presentation - PeoplePerHour workshop
Fotis Alexandrou
 
Python to go
Python to go
Weng Wei
 
Diving into SngularJS
Diving into SngularJS
francisspor
 
The Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cli
Tracy Lee
 
FuelPHP - a PHP HMVC Framework by silicongulf.com
FuelPHP - a PHP HMVC Framework by silicongulf.com
Christopher Cubos
 
Salvatore Laisa - Da Angular a React - Un viaggio inaspettato
Salvatore Laisa - Da Angular a React - Un viaggio inaspettato
Codemotion
 
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
Matteo Manchi
 
Back to the ng2 Future
Back to the ng2 Future
Jeremy Likness
 
So you think you can scale
So you think you can scale
Dan Beil
 

Similar to Angular ❤️ CMS from #AngularUp (20)

Unit 2 - Data Binding.pptx
Unit 2 - Data Binding.pptx
Malla Reddy University
 
Myths of Angular 2: What Angular Really Is
Myths of Angular 2: What Angular Really Is
DevFest DC
 
Angular js
Angular js
Felixits
 
Angular js
Angular js
Felixits
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 may
Luciano Amodio
 
Angular 2
Angular 2
alinabiliashevych
 
Predictable Web Apps with Angular and Redux
Predictable Web Apps with Angular and Redux
FITC
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017
Matt Raible
 
Creating a SPA blog withAngular and Cloud Firestore
Creating a SPA blog withAngular and Cloud Firestore
TMME - TECH MEETUP FOR MYANMAR ENGINEERS IN JP
 
Component based architecture
Component based architecture
Zaiyang Li
 
AngularJS best-practices
AngularJS best-practices
Henry Tao
 
Angularjs
Angularjs
Ynon Perek
 
Jquery react angular
Jquery react angular
Rafa D. Latorre López Villalta
 
Angular 2 overview in 60 minutes
Angular 2 overview in 60 minutes
Loiane Groner
 
Angular2 workshop
Angular2 workshop
Nir Kaufman
 
Rock your web with Angular - DevFest Bizerte 2018
Rock your web with Angular - DevFest Bizerte 2018
Saif Jerbi
 
Angular 4 Training | Angular Js training in Hyderabad
Angular 4 Training | Angular Js training in Hyderabad
N Benchmark IT Solutions
 
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
TamalDey28
 
Angular js 2.0 beta
Angular js 2.0 beta
Nagaraju Sangam
 
Walk in the shoe of angular
Walk in the shoe of angular
Fiyaz Hasan
 
Myths of Angular 2: What Angular Really Is
Myths of Angular 2: What Angular Really Is
DevFest DC
 
Angular js
Angular js
Felixits
 
Angular js
Angular js
Felixits
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 may
Luciano Amodio
 
Predictable Web Apps with Angular and Redux
Predictable Web Apps with Angular and Redux
FITC
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017
Matt Raible
 
Component based architecture
Component based architecture
Zaiyang Li
 
AngularJS best-practices
AngularJS best-practices
Henry Tao
 
Angular 2 overview in 60 minutes
Angular 2 overview in 60 minutes
Loiane Groner
 
Angular2 workshop
Angular2 workshop
Nir Kaufman
 
Rock your web with Angular - DevFest Bizerte 2018
Rock your web with Angular - DevFest Bizerte 2018
Saif Jerbi
 
Angular 4 Training | Angular Js training in Hyderabad
Angular 4 Training | Angular Js training in Hyderabad
N Benchmark IT Solutions
 
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
TamalDey28
 
Walk in the shoe of angular
Walk in the shoe of angular
Fiyaz Hasan
 
Ad

More from Filip Bruun Bech-Larsen (20)

Webcomponents from 0-100 - with Google's Lit
Webcomponents from 0-100 - with Google's Lit
Filip Bruun Bech-Larsen
 
Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friend
Filip Bruun Bech-Larsen
 
Content as a Service with Umbraco Headless
Content as a Service with Umbraco Headless
Filip Bruun Bech-Larsen
 
Frameworks and webcomponents
Frameworks and webcomponents
Filip Bruun Bech-Larsen
 
Whats next in clientside templating
Whats next in clientside templating
Filip Bruun Bech-Larsen
 
Whats next in clientside templating
Whats next in clientside templating
Filip Bruun Bech-Larsen
 
Whats next in templating
Whats next in templating
Filip Bruun Bech-Larsen
 
The future of templating and frameworks
The future of templating and frameworks
Filip Bruun Bech-Larsen
 
Whats next in templating
Whats next in templating
Filip Bruun Bech-Larsen
 
Future of the Web
Future of the Web
Filip Bruun Bech-Larsen
 
Diversity at impact
Diversity at impact
Filip Bruun Bech-Larsen
 
The Future of the web
The Future of the web
Filip Bruun Bech-Larsen
 
Frontend development of the (current) future
Frontend development of the (current) future
Filip Bruun Bech-Larsen
 
Commerce and the browser in 2017
Commerce and the browser in 2017
Filip Bruun Bech-Larsen
 
Frontend State of the union
Frontend State of the union
Filip Bruun Bech-Larsen
 
AngularJS best practices
AngularJS best practices
Filip Bruun Bech-Larsen
 
Frontend development of the (current) future
Frontend development of the (current) future
Filip Bruun Bech-Larsen
 
Observables - the why, what & how
Observables - the why, what & how
Filip Bruun Bech-Larsen
 
Angular2 workshop
Angular2 workshop
Filip Bruun Bech-Larsen
 
Progressive Web Apps og Payment Request
Progressive Web Apps og Payment Request
Filip Bruun Bech-Larsen
 
Webcomponents from 0-100 - with Google's Lit
Webcomponents from 0-100 - with Google's Lit
Filip Bruun Bech-Larsen
 
Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friend
Filip Bruun Bech-Larsen
 
Content as a Service with Umbraco Headless
Content as a Service with Umbraco Headless
Filip Bruun Bech-Larsen
 
Frontend development of the (current) future
Frontend development of the (current) future
Filip Bruun Bech-Larsen
 
Frontend development of the (current) future
Frontend development of the (current) future
Filip Bruun Bech-Larsen
 
Ad

Recently uploaded (20)

Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 

Angular ❤️ CMS from #AngularUp