SharePoint is versatile, in that developers can collaborate with its abstracts via added programming languages besides what’s in Visual Studio. Here’s how AngularJS fits into the development mix.
AngularJS provides accession way of giving activating looks to changeless abstracts with the advice of new HTML constructs, alleged directives. I’d abnormally accent these AngularJS features:
All of these appearance abutment architecture Create-Read-Update-Delete (CRUD) operations aural applications, but it’s not aloof about enabling CRUD operations but additionally about testability. You can use AngularJS for Ununit testing as able-bodied as apish testing with the accessible features.
Key AngularJS ConceptsBefore activity into the affiliation of AngularJS with SharePoint, let’s attending at some basal attempt of AngularJS that I accept are account noting:
Directives: Directives administer appropriate behaviors to the attributes or the elements in HTML. They can be added authentic as the markers on DOM elements that acquaint the AngularJS HTML compiler to attach a specific behavior to the DOM aspect and accomplish transitions if necessary. They basically alpha with an “ng” prefix and there are a set of predefined set of directives from which you can add custom directives. Actuality are some of the basal directives that you’ll best frequently use:
Model: A archetypal can be authentic as a set of abstracts that is to be apparent to the users. There can be archetypal elements that abide aural a folio and that abstracts can be anon apprenticed to reflect on the folio actual easily.
Scope: Ambit is an commodity that refers to the appliance model. It can be additionally advised as an beheading ambience for the expressions area we can address some AngularJS expressions to affectation some data, do some operations and so on.
Abstracts binding: Abstracts bounden is simplified with a accepted syntax and with adeptness to add filters to in in accessible ways. They acquiesce a specific archetypal aspect authentic in a ambit to be displayed aural html with the afterward syntax.
Now, let’s actualize a SharePoint hosted app via AngularJS.
Create the SharePoint Hosted AppOpen Visual Studio 2013 and actualize a new SharePoint App alleged Angular.App. Then go to http://angularjs.org and download the latest abiding absolution of AngularJS framework. The adaptation that was accessible as I wrote this commodity was adaptation 1.3x. From that, I alleged the minified version.
Now right-click on the Scripts binder and add the downloaded book to the scripts folder. It should be arresting (see Figure 1). If I aloof arrange the app and browse it, it should appearance the absence page.
Now abandoned the agreeable central the App.js book aural the calligraphy binder and add the afterward advertence to the arch area of the Default.aspx file:
Then alter the agreeable central the asp:Content tag with ID aspect PlaceHolderMain with the afterward content:
Now arrange the app and analysis browsing (see Figure 2). As you accumulate accounting your name in the textbox you can see the acceptable bulletin accepting updated. That is because there is a austere bounden of the archetypal property, which is alleged name. This is a simple archetype and a antecedent for affirmation on actual agreement of AngularJS aural SharePoint.
As you can see, we are appliance the ng-model charge and accession charge alleged ng-app. The ng-app charge designates the basis aspect of the appliance and is about placed a the basis aspect of the folio or area AngularJS charge to be active.
Two added concepts account acquainted as we advance added are the Controllers and the Services.
The controllers in AngularJS attach a ambassador chic to a view. This is one of the key components, accustomed AngularJS supports the MVC architecture arrangement implementation. Ambassador for a accurate appearance can be authentic with the ng-controller directive.
Casework in AngularJS accommodate a greater way to affix the altar appliance a software architecture arrangement accepted as annex injection. Casework are commonly acclimated for acclimation and administration the cipher beyond a accurate app. Accustomed it uses annex injection, a account is alone accomplished back an appliance basal feels the charge to depend on it.
There are some congenital casework that starts with the “$” tag such like “$http”. Best of the time we end up autograph our own account to booty affliction of any added appropriate functionality.
All these services, directives and added AngularJS apparatus are initialized through a abstraction alleged Modules in AngularJS. Modules accomplish cipher easier to assemblage analysis and alter as able-bodied as improves the portability of the cipher to a greater extent.
Connecting to SharePoint Account DataTo authenticate the alternation with AngularJS and SharePoint, let’s actualize a account that contains cine names. Right-click on the Visual Studio activity and advance with Add | New | Account and name the activity as “Movies.” Select the custom account arrangement as the account template.
Open the account arrangement in Visual Studio and add two new columns, “Directors” and “Year,” which will be distinct band of argument fields (see Figure 3). This will actualize a account alleged Movies in the App Web anniversary time it is deployed.
Now let’s see how we can appearance the account items added to this SharePoint account aural a SharePoint page.
First alter the agreeable central the asp:Content tag with the ID PlaceHolderMain with afterward HTML. This was beforehand afflicted to affectation a basal AngularJS archetypal binding:
Here, I accept authentic an app alleged “store” area the AngularJS functionality will arise in the page. It can accommodate assorted controllers that are accessible for implementing the functionality, but in this case I aloof charge one alleged “movieController.” In accession to those two I accept acclimated a charge alleged “ng-repeat,” which functions analogously like a For…Each bend that best developers are acclimated to seeing in accustomed programming languages. Aloof like we’d do with best acquisitive programming languages, actuality we can admission the backdrop of a cine article that is represented in a capricious alleged “item.” I’ve additionally fabricated references to two properties, Title and Year.
Next, accredit a ambassador alleged “movieController” that is assigned for the ng-controller directive:
As you can see I accept assigned a capricious alleged movies with a account I am creating alleged “SharePointList” that’s apparent in Listing 1.
Listing 1: SharePoint Account Account
The 8 Common Stereotypes When It Comes To Sharepoint Form Templates Download | Sharepoint Form Templates Download – sharepoint form templates download
| Allowed to be able to the blog, with this time I’ll teach you in relation to sharepoint form templates download