SharePoint App: Simple Photo Gallery AngularJS
On SharePoint
Today, I will explain in details how to create a SharePoint hosted app using AngularJS Framework, The app itself is a very simple app it contains the following:
Name your App and choose its location.
Secondly , you need to select or enter the sharepoint Site you will use to debug the app it can be a developer site or any other site which have the sideloading feature enabled.
to learn how to enable sideloading feature for any site, check this great post by Alexander Vanwynsberghe
Back to our app, let's create a new app part and name it AlbumViewer.aspx , after the creation of the aspx page, let's make the App Part Angular friendly !
Also in the Default page you will find a link to the PhotoLibrary which is created in the app web to store the user images.
- Image Library to store your images
- App Part loads the Images within the library and displays thumbnails of the images, upon user click the full image will appear in a lightbox.
First step is as usual creating a new Visual Studio Solution and create new Project , select Apps under Office/SharePoint then select App for SharePoint.
Name your App and choose its location.
Secondly , you need to select or enter the sharepoint Site you will use to debug the app it can be a developer site or any other site which have the sideloading feature enabled.
to learn how to enable sideloading feature for any site, check this great post by Alexander Vanwynsberghe
Back to our app, let's create a new app part and name it AlbumViewer.aspx , after the creation of the aspx page, let's make the App Part Angular friendly !
- add the AngularJS link
- Add the ng-app attribute to HTML tag
- Add the ng-controller attribute to our container DIV element
- let's add new Javascript file which will act as AngularJS app controller.
- GetItemsREST: utilizes List RESTful APIs to get the image library contents.
- GetApplicationConfig: used to read the application settings which the user can edit to control the number of images appears in the app part.
- AngularJS app initialization.
- Now we need to add reference to the controller JavaScript file to the app part.
The controller will contain three different main functions:
Also in the Default page you will find a link to the PhotoLibrary which is created in the app web to store the user images.
and this is how it looks in action !
You can download complete source code from this link and the app is already published to the office store
Happy Share-pointing
No Comment to " SharePoint App: Simple Photo Gallery AngularJS "