Here we add “spcrud.ts” library with CRUD methods to save JSON data over REST api into SharePoint Lists. SPCRUD is a Typescript library with methods to easily interact with SharePoint APIs by providing management of Digest Token, HTTP headers, and URL formatting. As developers we interact with simple TypeScript methods that have input validation which in turn execute the correct underlying HTTP call.
Angular 2 (“Angular”) brings many improvements over Angular 1 (“AngularJS”). The CLI tools (Command Line Interface) help streamline operations so we can develop professional applications with ease including unit testing, bundling, minification, live preview, webpack, distribution, and more.
The below demo shows how to create a new application, run tests, add features, and deploy to SharePoint Pages hosted in a Content Editor Web Part. The CLI tools boost developer productivity while holding up quality control.
Check out the live coding video below, hosted on both Vimeo and YouTube.
For Angular2 to load correctly on a SharePoint page we must comment out the line “import ‘core-js/es6/string’;” from “polyfills.ts” to avoid conflict with Microsoft Script Resource AXD code already included.
Uncaught g {__zone_symbol__error: Error: Sys.ParameterCountException: Parameter count mismatch.
Ever wanted to code a JavaScript content editor (script editor) web part that saves settings to a list? Without jQuery?
The library below “wp-settings.js” does exactly that with native XHR (XML HTTP Request) and nested callback to invoke REST API. The free standing POJO (Plan Old JavaScript Object) design enables us to package into a web part gallery and use freely across any site without preparation work to ensure jQuery, Angular, or other dependent frameworks are loaded.
Look at the “webpart.html” to see example usage pattern: