Posts

Showing posts from 2015

Post ngRepeat Code

all those questions,
How to run function after ngRepeat is done
Calling a function when ng-repeat has finished
ng-repeat finish event

all the answers in stackoverflow goes around
<ul><ling-repeat="item in items"ng-init="$last ? doSomething() : angular.noop()">{{item}}</li></ul> which are nice and are a real solution, while each answer eventually give the same solution a bit more generic.

one blog puts it quite better, while also enabling to choose the digest cycle stage, with the exception that you better use $parse instead of $eval:
http://www.bennadel.com/blog/2592-hooking-into-the-complete-event-of-an-ngrepeat-loop-in-angularjs.htm

but in the end we usually just do some simple JS or JQ code or plugin, and i think that the real solution here is a simple setTimeout since the setTimeout function gets pushed to the end of the queue of the browser, its always right after everything is done in angular, usually ngReapet which continues after its p…

Create Visual Studio project for Sharepoint

Image
Many time we, Developers, gets a dev environment with a SP farm and need to get to work.

it usually comes in 2 stages, 1st is to create a new WebApplication up to having an actual site running, and that is covered here.

this is the 2nd part where we create a new Visual Studio project for Sharepoint and connect it to our brand new site :).

1. Open Visual Studio (da...)

2. Click "New Project", enter "sharepoint" in the search box, and choose "SharePoint 2013 - Empty Project"

3. in the opened dialog box, enter the domain url for your new site, and choose "Farm Solution"

4. Create new item

5. in the search box enter "webpart" to see available webparts templates, in this tutorial we will add a visual webpart. notice that in SP2010 the resutls will be a bit different. BTW, i prefer the UC/SmartPart template like in SP2010 and still use it since its much easier to change an .ascx file, while with this template even the ".ascx" is ac…

Create New Sharepoint Web Application all the way to the site tutorial

Image
Many time we, Developers, gets a dev environment with a SP farm and need to get to work.

it usually comes in 2 stages, 1st create a new WebApplication up to having an actual site running, and thats whats this post is about.
2dn part here.

1. Open Central Admin

2. Go to "Manage Web Applications"

3. Click in the ribbon on "New" to create a new WebApplication

4. Fill the following

and when you scroll down also


    and after a long wait...
5. Click "Create Site Collection:


so that you get this window, and fill the relevant inputs



6. while this is going, you'll need to teach your local DNS the address for you new site, so open the "Run" window by pressing the window key + R and input "drivers"

7. open the "etc" folder

8. edit the "hosts" file. note that in some versions of Window you must either open "notepad" as administrator or copy the file outside this directory, edit it, and copy it back.

9. Add the new dom…

sharepoint 2013 and angular js - development tutorial

so we want to just do an SPA with angular for the "front end" site, and leave SP as a CMS

well unless you put he main html file in the root, as in <server>\index.html, you will get a download everytime you try to browse to the file. this is a security feature and can be canceled with simple PS from here https://gist.github.com/wpsmith/484eb67652b3c928940d. the example is about html files.

next thing, SP-wise, is getting your data. there you have 2 options, the "regular" rest api and the search rest api. the search, for getting data, is much faster, but you need to activate the search.

url for search will always be like this
/_api/search/query?querytext=<your query>&selectproperties='<Title,ListItemID, ect.>'

notice that in the search you dont have the standard "Id" property but ListItemID.

to map this enormous object to something normal, you can create a simple mapping function

var toNormalItem=function(cells){   varnormalItem…