Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

Video

Generate TypeScript interfaces from JSON data

Autocomplete JSON property names in JavaScript by generating TypeScript interfaces from sample JSON data.  Check out the below video for a live demo.

Huge win for developer productivity.  No more property name guessing or typos!

 

  1. Copy sample JSON from http://json.org/example.html
  2. Paste into http://json2ts.com/ by @Sorskoot to generate TypeScript interfaces
  3. Add TS file to application working folder
  4. Enjoy autocomplete with Visual Studio Code!
    shades_smile

 

VIDEO

 

SOURCE CODE

Video – Get Started with SPCRUD.JS

Check out the below 10 minute video for how get started using “spcrud.js” to easily connect Angular JS applications to SharePoint List data.    I created this library as a wrapper for AngularJS $http GET and POST.     We can streamline the repetitive SharePoint plumbing of JSON headers, HTTP VERBs, and URL syntax.    Now you can easily call “spcrud.read()” or “spcrud.update()” instead of formatting each HTTP request.

Enjoy!! 

shades_smile

Please leave a comment if you found this helpful. 

 

SharePoint Online – Configure PowerShell with remote cmdlets

Check out this quick 7 minute video for how I configure my local PowerShell console with both Microsoft and community cmdlets.   Remotely manage Office 365 sites with Global Administrator rights or even simple Power User.   Options exist for all access levels.

Please leave a comment if you found this helpful.  Enjoy! 

shades_smile

 

Download

 

PowerShell

 

Video

BreezeJS – Edit SQL table with < 100 lines of JS code [VIDEO]

With SharePoint 2013 and industry movement towards the cloud I’ve been exploring JavaScript as a primary way to develop rich applications.

One common challenge is data access.  

With C# I have years of experience with [System.Data] and can perform CRUD against SQL relational databases in my sleep.  Open connection, query, data adapter, fill DataTable, and voila!    Muscle memory. Second nature.  Tried and true methods.   However, in the new client side JS world I had no clue where to begin.

Enter Breeze.

 

People describe Breeze as “Entity Framework on the client in JavaScript” which sounds simple yet has profound implication for the developer.   CRUD operations, LINQ style query, navigating primary/foreign keys, input validation, caching, batch updates, and more.   That’s a lot to consider and new ideas take time to absorb.   Breeze could potentially replace:

  • ASP.Net (ASPX) web forms
  • ASCX user controls
  • InfoPath forms
  • SharePoint web parts
  • WCF 5.6 data services
  • OData
  • Classic WebAPI

 

I set out to code an example with a few goals:

  • Create simple SQL schema (two tables – parent/child – one to many)
  • Execute CRUD operations in JS against SQL  tables
  • Leverage JS plugins and NuGet “Install-Package” to load third party components
    • Install-Package breeze.webapi2.ef6
    • Install-Package breeze.angular
    • Install-Package angularjs.core
  • Little code as possible

The whole thing took less than 30 minutes and I edited video down to just 15.    I was impressed by how straightforward and easy the process was.   Breeze# in ASP.Net MVC for the back end WebAPI controller was nearly identical to the Breeze example code.   Add one C# method per entity (SQL table) and Breeze does the rest.  The JS front end took a little more time to understand but was also easy to apply.   Connect  Entity Manager to the Breeze URL and you’re ready for CRUD queries.    Amazing!     Given how easy Breeze is I would be hard pressed to use OData or manually created WebAPI controllers with C# code to query a database.   If you can use Breeze, then use it!    You’ll save lots of effort.

Please leave a comment if you found this helpful.   Thank you! 

shades_smile

 

Watch Video

[BreezeJS and WebAPI – Edit SQL table in JS with less than 100 lines of code]

 

Download Code

Download

http://spjeff.com/etc/Appraisal-Breeze-VS2013.zip

 

Screenshots

image
image

 

image

 

References

 

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲