I am in need to implement a static SPA with JAMstack architecture. I know we can user ReactJS/VueJS for JAM based implementation. But I want to know is it possible to use Angular for JAMstack approach?
As JAMstack stands for JavaScript, API, and Markup, the only part which is a bit less straightforward to do Angular as a JAMstack is the markup.
It is possible to pre-render Angular on the server with Angular Universal: this would be the Markup part of the JAMstack. To make it a JAMstack application you would have to use build time pre-rendering instead of server-side rendering.
Angular is JavaScript obviously, so that is pretty straightforward.
And your Angular app probably already is talking to APIs, so that is easy too.
The main thing would be to build your Angular app in such a way that it works as a standalone website and serving it as static files via a CDN. Any content that needs to be dynamically updated you call via an API.
So yes, in my opinion it is possible to use Angular for JAMstack.
I'm not sure if you are talking about Angular(2+) or AngularJs(1), but anyways there is no tool that use any of those frameworks, but, here you can see all the current tools you can choose to build an app with the JAMStack
You can find some that use Jade, Handlebars for generate the templates. Maybe Angular is not present because is too big, a complete framework, and in these cases you most of all need a template helper.
So, good luck.
Things move fast in the web world, there now (since December 2019) is a Static Site Generator built in Angular: https://www.netlify.com/blog/2019/12/16/introducing-scully-the-angular-static-site-generator/
The Scully code (currently version 0.0.1 so probably not stable/production ready): https://github.com/scullyio/scully/
An explanation of JAMstack "through Angular-colored glasses": https://www.netlify.com/blog/2019/10/30/whats-angular-in-the-jamstack-it-sounds-delicious/
As i understand. JAM stand for :
- Javascript : to handling pre-generated content on client , fetch updates via API
- API : response for request from client , sent the markup out
- Markup : the pre-generated content (i'm sure it's called Serverside Rendering also)
So you can obviously build JAM with Angularjs. Here are a few references that I know of, might enough to create JAM with AngularJS
- J : AngularJS famework it self. Use $http service for API requesting
- A : Express module - NodeJS
- M : https://github.com/runvnc/angular-on-server or https://github.com/ng-consult/ng1-server (didn't test any of these)
© 2022 - 2024 — McMap. All rights reserved.