APIs & Integrations

ammuench
Member

Deploying an Angular Application to Hubspot

Hello!

I'm currently working on an Angular-based PWA and my client said they wanted to host it with Hubspot.  Unfortunately, they were unable to let me know the process for that.

I'm curious if anyone has deployed a webapp on hubspot, and what the process for doing so might be.  I'm hoping Angular will work, but I can re-architect stuff if the process would be substantially easier. 

Right now I've got everything building out to a folder that contains all the relevant JS files, css files, an index.html entrypoint, some JSON files to handle the service workers, and an assets folder with images.  I'm very new to this platform and am unsure how to get this properly deployed and hosted though.  Any help would be much appreciated!

0 Upvotes
4 Replies 4
vsharma9
Member

Deploying an Angular Application to Hubspot

hello sir could you help me in how to integrate hubspot in my angular project if you could help please reply as soon as possible

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Deploying an Angular Application to Hubspot

Hi @ammuench,

 

I hope all is well with you 🙂

 

While HubSpot doesn't support Angular out of the box, ultimately, angular compiles to HTML/CSS/JS, even if what your team writing is typescript and angular components.

 

Here are some tips to have angular run on a HubSpot page:

1. Pre-compile the angular assets and upload/link to them, or put the raw contents in a custom module

2. Angular uses the same `{{ }}` syntax as HubL, so for pages to publish properly, they need to place any Angular code inside a HubL raw tag - Escaping HubL delimiters

 

Note: This will also depends a bit on which version of angular your team is using, because angularjs 1.0 is different from the more moder angular components.

 

Hope this helps to clarify!

 

0 Upvotes
ammuench
Member

Deploying an Angular Application to Hubspot

@WendyGohthank you for the help, the Angular module seems to work no problems now!

Do you have any advice on how to properly register the app as a PWA?  I keep running into errors with my service worker being registered on pageload

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Deploying an Angular Application to Hubspot

Hi @ammuench,

 

Currently HubSpot pages doesn't support PWA; which explains why you're running into errors. That said, I'd recommend jumping over to this existing idea posted here on our: HubSpot idea forum and give it an upvote. Hopefully this will gather more interest.

 

 

0 Upvotes