Posts

Angular not working in IE, 10 $digest() iterations reached. Aborting!

http://stackoverflow.com/questions/13853844/angular-js-ie-error-10-digest-iterations-reached-aborting last answer - remove the 'href' from everywhere, including directives and it works. if u want the link style system to work then put href="".

show image after load Example

the sln belongs to :  http://forums.techguy.org/web-design-development/1036902-inhibit-display-img-until-100-a.html this is super simple: HTML:  <img class="hideMeBeforeLoad" onload="showMeAfterLoad(this)"> CSS:        .hideMeBeforeLoad {    display:none !important; } JS:           function showMeAfterLoad(img){ $(img).removeClass("hideMeBeforeLoad"); }

AngularJS and AJAX - angular is not updating / refreshing

if u'll try to make an AJAX based angluar app u'll run in a few problems of data not updating right. thats becuz the $http.get/post runz async and ur controllers and direcitves finish their jobs, and even if u call them again sometimes its not enough. so 1st thing is to use some broadcasting, in the service family there is $rootScope.$broadcast('eventName'); the controllers use  $rootScope.$emit('eventName'); and u can even send args with them. then in the controllers / directives u should do this: scope.$root.$on('eventName'); with DOM manipulation directives do: scope.$root.$on('eventName', function(){   $timeout(function () {      //code   }); }); this is a kind of 'onDigestComplete'.

Clear / Clean / Delete angularJS $location.search()

Bresleveloper's AngularJS tutorial:  $location.search() :) i tried a few thing but the only thing that worked was  for (prop in $location.search())          $location.search(prop, null);

AngularJS create directive with ng-repeat example

Bresleveloper's AngularJS tutorial: Directive :) goooooo Angular!!! there r still no simple tutorials about angular's bit more advanced stuff so i'll share my part and today about directives. so basically a directive is all the "ng-xxx" attrs, meaning that they have a JS function that tells them what to do with the specific HTML element. so the most basic thing u can do it this: <span myboldme>bla bla</span> and in the js myModule.directive( " myboldme " , function ($compile) {   return function (scope, element, attrs) {     var b = "<b> </b>"     var boldElem = angular.element(b);        boldElem.text(element.text());     $compile(boldElem)(scope);     element.replaceWith(boldElem);   } });   and u get <b>bla bla</b>. YEP!! all those element given by angular r JQuery objects :) now my ...

AngularJS and AJAX filtering / refreshing tutorial, AngularJS Init Data from AJAX tutorial

I decided to start my oen AngularJS tutorials, so i'll put some data for google to mattch: Bresleveloper's AngularJS tutorial: Controllers :) i should put this on utube but for now... I also don't care about the double title, as long as ppl will find it cuz that's the queries I put in google and got nit. OK so u want to build an awesome app with the awesome new thing (it has many names) called AngularJS. maybe u've seen this great tutorial: http://www.youtube.com/watch?v=i9MHigUZKEM u see all the tutorials and make something like this: <div ng-app="myApp">   <div ng-view><div> </div> and did a nice view with ng-repeat and u want to give it a kick so u do: var myModule = angular.module( 'myModule' , []); myModule.config( function ($routeProvider) {   $routeProvider.when( '/' , { controller: 'myController' , templateUrl: '/View1.html' })     .when( '/View2' , { controll...

Sharepoint 2013 Create Anonymous Extension - the TRUE and REAL tutorial

Image
so the web is full, with partials tutorials, so the noob me is gonna write the conclusions of 2 half days of suffering (THX MS!). sry for the big pics, i decided to make it ugly but friendly. 1. go to Central Admin, Application Management, Manage web applications. Click on your webApp and then in the ribbon click (on the right) Extend. do the usuall with 2 exceptions: 1st choose allow anonymous, 2nd DONT remove the window authentication not its NTLM checkbox, we will need it yet and remove it in the end. (if u want to be sure click Authentication Providers and choose your new extension and allow all site, but its usually ok unless u changes something). 2. go to you brand new site  (you should not touch your admin site - thats only a myth), you should have a ribbon cuz ur authenticated (logged in to SP) go to Site Settings, Site Permissions, you should now see in the ribbon Anonymous Access, click it and the modal should already have chosen Entire Web Site and click OK (if u ...

how to use XslCompiledTransform, XSLT in c# (server side), and how to use it with Sharepoint

scenario 1: I just want to do XSLT in server side: in most examples on the web u'll see stuff like this: // Load the style sheet. XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load( "output.xsl" ); // Execute the transform and output the results to a file. xslt.Transform( "books.xml" , "books.html" );   now many times u'll and want to use the XmlReader and the XmlWriter classes, and there u'll start getting exceptions. T he main reason is that those 2 classes really check for your XML, XSL and the output, so unless ur a goody good boy with XML-XSL its really annoying. One main example is that in my scenario I want to create a chunk of HTML but as a DIV, not a whole document, so you need to explicitly tell that to the result output. so there r ways to continue and be a goody good boy and the only place I found good and exact info about all that is here: http://stackoverflow.com/questions/6214354/problem-with-xslco...

Sharepoint ConnectionString for Jobs

THX to Elitzur and Eran for this one!!! if u ever make a job in SP and in the job u want to get a connectionString from our beloved ConfigurationManager you will not find it! this is becuz the OWSTIMER process (SharePoint Timer Service) has its own config file. go to your 15\BIN (or 14\BIN) and find OWSTIMER.EXE.CONFIG and put ur connStr there. dont forget to refresh the OWSTIMER. some more info about jobs (for noobs like me XD): jobs r running in the OWSTIMER process and therefor dont have any context(es) with them, so you cant cache stuff (my original will), you dont have ur web.config and other IIS related stuff.

Html Table Pagination: Real True and Complete (and Simple) Javascript with JQuery

i did a mixture and optimization from these 2: http://gabrieleromanato.name/jquery-easy-table-pagination/ http://dotnetcluster.blogspot.co.il/2011/07/paging-in-html-table-using-javascript.html now it has <<first, <<prev, 5,6,7,8,9 next>> last>> i also added it to my Bresleveloper.js lib: http://bresleveloper.blogspot.co.il/2013/06/my-extenxtion-javascript-namespace.html < script type ="text/javascript"> $( function () { $( 'table.paginate' ).each( function () { var $table = $( this ); var itemsPerPage = 10; var currentPage = 0; var pages = Math.ceil($table.find( "tr:not(:has(th))" ).length / itemsPerPage); $table.bind( 'repaginate' , function () {   if (pages > 1) {   var pager;   if ($table.next().hasClass( "pager" ))     pager = $table.next().empty();    else   pager = $( '<div class="pager...