Continuous Deployment of Angular Application in SharePoint
Continuous Deployment of Angular Application in SharePoint
(https://www.sumitagrawal.io)
04 Oct 2017
Angular-cli makes it possible to rapidly develop client side applications. It is really easy to debug
angular applications locally using Hot Module Replacement that angular-cli brings. If we are using
client side libraries with SharePoint, we have to upload the updated code le every time it is
changed and does not provide a good development experience. In this post, we will build
Continuous Deployment pipeline that can be used to building and debugging angular applications
with SharePoint. One caveat to this approach is that is not following standard build and package
process that SharePoint Apps and SharePoint Framework provides. If you want more controlled
way for distributing apps SharePoint Apps/Framework should be preferred for packaging. If you
want to use scipt editor webpart and ability to easily test and develop client side components, you
can take advantage of this Continuous Deployment pipeline.
Tools Required:
1) NodeJS - install from https://nodejs.org/en/
2) Angular CLI - Install using npm install -g @angular/cli
3) Code editor of your choice - mine is VS code - https://code.visualstudio.com/
4) SharePoint Online environment
https://www.sumitagrawal.io/spng01/ 1/6
2017. 12. 12. Continuous Deployment of Angular application in SharePoint
Go to command line and run ng new mysp-app to scaffold a new angular project. This will also
install all the required Node packages.
https://www.sumitagrawal.io/spng01/ 2/6
2017. 12. 12. Continuous Deployment of Angular application in SharePoint
and these les are referenced in our index.html le which is also generated in output directory
angular routing. We are specifying here that for all routing use this page as base URL.
Second change that we have made is updated all script and stylesheet urls to the ones that are
there in SiteAssets library. Also note that le names are changed and we have removed hash from
lename. This change is done so that whenever new les are generated by angular-cli, we do not
have to change le references in our script editor webpart content.
If you navigate to your webpart page now, you should be able to see Hello World Angular
Application!
We are instructing angular cli to run the build process in watch mode so that as soon as any les are
changed in our source code, angular cli will build the application in production mode without any
hashes and push outout to OneDrive folder, OneDrive will sync these changes to our SharePoint
site assets library and out script editor webpart will have updated les after hard refresh (Ctrl+ F5)
That is all!
In next post, we will see how to add Routing and and use Angular Service for SharePoint CRUD
operations.
https://www.sumitagrawal.io/spng01/ 4/6
2017. 12. 12. Continuous Deployment of Angular application in SharePoint
Author
SUMIT AGRAWAL
(/AUTHOR/SUMIT/)
PREVIOUS POST
NEXT POST
https://www.sumitagrawal.io/spng01/ 5/6
2017. 12. 12. Continuous Deployment of Angular application in SharePoint
Comments
0 Comments sumitagrawal.io Zoltán Perhács
Sort by Best
Recommend ⤤ Share
sumitagrawal.io requires you to verify your email address before posting. Send verification email ×
to [email protected]
https://www.sumitagrawal.io/spng01/ 6/6