LightSwitch in Visual Studio 2013 has new features, including better team development support and improvements in building HTML client desktops and Office 365 applications. This document is illustrated with the ANGULARJS provided by the newly released Wijmo 5.
Based on Visual Studio LightSwitch as a data source, we use WIJMO 5 controls to quickly create ANGULARJS applications.
Inserting data records
Business Rule Validation
Data record Updates
Select data Record, click on Keyboard to delete button
Click on the column header to sort the data
Concurrency check (provided by the backend of the LightSwitch).
Wijmo 5 Control set
October 7, 2014---Grape City announced the official release of Wijmo 5. Wijmo 5 is no longer compatible with the traditional browser (<= IE9), the pure HTML5 control set. Also, angular JS will be fully supported in the release and Wijmo of all 5 controls.
Why use Wijmo 5 and LightSwitch?
for the 100% control UI: The LightSwitch HTML client is based on jquery Mobile, which results in a significant amount of time spent in order to control the UI.
to achieve security : Security policies are typically implemented on the server side. cannot be achieved through ANGULARJS front-end technology. LightSwitch makes security very easy to implement.
in order to handle concurrency : When multiple people update the DB at the same time results in concurrency, fortunately, LightSwitch has implemented this feature automatically.
in order to use LightSwitch to manage the interface code : Based on LightSwitch, we do not need to use ANGULARJS to implement the management interface code, LightSwitch has been implemented, So combining LightSwitch and Angularjs makes programming very easy.
to speed up development : The current use of LightSwitch can greatly reduce code writing, which means that the development process accelerates and bugs are reduced.
The examples are as follows:
LightSwitch Business Layer
In the solution view, in the data source datasources right-click, select Add Table
Create a Todo table
Click the Write Code button, select the Validate method, and in the generated template, insert the validation code.
(Entity. TaskName = = (entity. Iscomplete = = Intcountofincomplete = = = = = X.iscomplete = = = x.id! = (Intcountofincomplete >
Wijmo 5 Code
Wijmo 5: Enter your email address to get the download URL
Unzip the Wijmo sample and navigate to the ".. \samples\js\angular\odata"directory, copy the vendor and styles folders to the Scripts folder of the LightSwitch Server project.
Create the Wijmo.data folder, download the odatacollectionview.js, and copy it under the Wijmo.data folder.
Angularjs Code
Create the App.js script file under the Scripts folder and enter the following code.
App = Angular.module (' app ', [' WJ ']);
Create the Controllers folder under the Scripts folder and create the Appctrl.js, and enter the following code.
' Use strict ' app = Angular.module (' app ' Apptodoctrl ', Odataservice = '/applicationdata.svc ', datatypes = $scope. Cvtodo = ' todoes ' id ' id ', ' RowVersion ', ' taskname ' iscomplete ', ' Created ', ' Modified ' $scope. CvToDo.error.addHandler (
Creating HTML pages
Create the Todo.htm page and enter the following code:
<! doctype html> Add Wijmo Grid code within <body>:
<div> <wj-flex-grid-add-= "true"-= "true"-source= "Cvtodo" > <wj-flex-grid-= "taskname" = "300 "=" Task Name "> </wj-flex-grid-column> <wj-flex-grid-=" iscomplete "=" Boolean "=" $ "=" IsC Omplete "> </wj-flex-grid-column> </wj-flex-grid> </div>
Reference article:
Illustrations Angularjs Wijmo5 and LightSwitch