понедельник, 6 апреля 2015 г.

Decorators in AngularJS, $provide.decorator

$provide.decorator if defined in config section of the application code and modifies original object which is passed as $delegate argument into decorator.

Here is set of examples giving better view on a powerful feature of decorators, available in AngularJS:

четверг, 2 апреля 2015 г.

angularJS photoshop demo

This demo uses canvas drawing directive and bootstrap-css for UI.
It has basic palette of colours and brush sizes and also layers that can be added/removed, activated or hidden.
Check it here: http://embed.plnkr.co/sn5eZV/

четверг, 20 ноября 2014 г.

Webdev workflow schema

  • http://yeoman.io/ and install npm install -g yo
  • http://bower.io/ and install npm install -g bower
  • http://gruntjs.com/ and install npm install -g grunt-cli

воскресенье, 9 ноября 2014 г.

more AngularJS details

AngularJS scope and watch

1) $scope.$watch(VAR, CALLBACK)
2) $scope.$apply() - notify about changes
3) AngularJS scopes are organized in a tree structure and a scope can access its ancestor’s variables. Well, this means that $digest() needs to happen on every child scope in every iteration! Internally, this code is a bit messy in AngularJS, but each iteration of the $digest() loop does a depth-first search and performs the watcher check on every child scope. If any child scope is dirty, the loop has to run again!
4) UI is blocked while $digest() is running
5) angular.equals(A, B) - internal angular function for comparing