Angular

Single Page Applications

The evolution of programming

With new technologies comes new opportunities

New advances in standards and the tools we have to program applications come ever more frequently. But this has not always been the case. The journey to where we find ourselves today with Angular has been a long one…

The only way of programming that existed

The days of Fortran and COBOL are almost forgotten. Visual Basic, C and C++ are now antiquated. With the arrival of the internet, HTML, server programming (PERL, PHP) and client-side programming in the form of JavaScript, we have been able to forget about distributing applications, installations and updates. The latest version is always online. But back then we were caught in the middle of the browser wars, creating different versions of applications according to what each browser could do.

For many years what we were able to implement using the internet technologies of the day was not capable of duplicating native applications. With the exception of some special cases this is now no longer the case.A long time ago...

JavaScript - the teenage years

In the past few years HTML and ECMAScript (the standard on which JavaScript is based) have seen some radical changes to respond to the new needs of internet users and their mobile devices which have become the de facto way of connecting.

JavaScript has historically been criticised by many ‘traditional’ programmers for its lack of certain concepts which, according to them, are necessary for a development platform to be enterprise ready. These criticisms have now been answered. Function libraries such as jQuery started to appear 10 years ago and have evolved into a series of new advanced programming frameworks, ready for use by any size of organization.2006

AngularJS - Single Page Applications (SPA's)

AngularJS began in 2010 by Google as a single page application framework – an application which appears to have various pages but without the requirement of reloading the browser each time the interface has to change.2010

A mature, powerful and efficient platform

Now known simply as Angular, in it’s v6.0 supported by many other organizations including Microsoft. It is implemented and uses TypeScript – an evolution of JavaScript taking advantage of the latest advances of ECMAScript which is then compiled back to JavaScript to be able to be executed in older browsers.

Combining Angular with a responsive design platform like Bootstrap we have the capability to create modern applications which work on all devices.Today

But where do we save the data?

The majority of applications require that data is shared between users and for this a server is needed.

Luckily evolution has not been limited to client-side programming – server-side programming has also advanced and now we do not have to suffer the nightmare of constant ‘postbacks’ that existed in .Net and other server platforms. Node.js is a new server platform also programmed in JavaScript allowing the same programming language to be used for all parts of a modern application.

The focus of server-side programming has changed radically – instead of attempting to execute all the application logic and present the interface to the user, now it is limited to providing web services which the browser-based applications can consume. All the modern server programming languages support the creation of web services and the generation of generic methods for whatever subsystem whether that be a database, ERP, etc… This means the same web services can be used by multiple different applications, greatly reducing the amount of programming necessary.

There are multiple benefits: better scalability, improved user experience, a simpler development environment with more powerful and automated tools which reduce development time and improve the quality of the applications.

SharePoint and Angular

A match made in the cloud

Jarmit Consulting has always been at the forefront of internet technology. In SharePoint we have used JavaScript and jQuery to add functionality to the platform since SharePoint 2003 but then we were more or less restricted to modifying elements of the interface already created by SharePoint.

By SharePoint 2007 with the first web services based on SOAP 1.0 and XML we had the ability to interact with the information and files stored in SharePoint without having to turn to server-side programming.

Now with SharePoint Online and SharePoint 2016 we have an ample REST API which allows us to access, create and modify any information inside the environment and we also have WebPart pages to easily publish our applications. Building on sites, lists and libraries, Angular applications can take advantage of the functionality and security already present in SharePoint instead of having to reprogramme it – another important advantage permitting greatly reduced development times.

In Office 365 we have the new Graph API which allows us to interact with the other services such as OneDrive and Teams. While the functional coverage is incomplete and Microsoft keeps adding new services and capabilities to the platform, it is sure to be a powerful tool for use in applications in the near future.

SharePoint Online

Don’t touch that server

Before the cloud the traditional way to add functionality to SharePoint was server-side programming in one form or another. For stability and security Microsoft do not allow these types of solutions in SharePoint Online. The only option until recently has been ‘Add-ins’ – apps in Azure separate from SharePoint but, with a certain amount of difficulty, able to interact with data on the platform.

SPA’s created in Angular or other similar frameworks eliminate all the difficulties and additional costs related to Add-ins.

Migrations

Programme once – not every time

Many companies and organizations are using previous versions of SharePoint and still require functionality specific to their needs to be added to their current platform. With applications created in Angular when the time comes to migrate to the latest version of SharePoint on-premise or make the jump to SharePoint Online no reprogramming is necessary. As all the interactions between the application and SharePoint go exclusively via web services which Microsoft must maintain in future versions it is possible to create an application for SharePoint 2007, 2010 or 2013 and copy it straight to SharePoint 2016 without any modifications.

The options are clear: pay each time to reprogramme ‘traditional’ applications in SharePoint when you migrate to the latest version or pay once for an Angular app with all the additional advantages it brings and never have to reprogramme again when you migrate.

Looking to the future

Microsoft are on the same road

The ‘Add-ins’ as an extensibility solution for SharePoint ended up being too complicated to easily implement. Microsoft has recognized this and have created a new development platform – SharePoint Framework or SPfx – to substitute it.

SPfx is client-side programming platform which allows developers to use the latest technology and tools in their applications. At the moment there is support for applications based on the programming frameworks React, Knockout and of course AngularJS and Angular.

While SPfx is still somewhat immature as yet, Microsoft is working hard to improve it and complete the support documentation which is critical for developers to be able to use it.

Until SPfx is a tried and tested platform ready for enterprise production environments we will continue to use our development stack, secure in the knowledge that it is backed by Microsoft who are also working in the same direction.