Sunday, October 19, 2014

python - PIP : ImportError: cannot import name IncompleteRead

I got the error:

ImportError: cannot import name IncompleteRead

The solution was reinstalling pip:

sudo easy_install freeze
sudo apt-get remove python-pip
sudo apt-get autoremove
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py --no-check-certificate
sudo python get-pip.py

Resource:

http://suanfazu.com/discussion/140/pip-install-importerror-cannot-import-name-incompleteread/p1

Angular js: re render directive dinamycally

Here is a great and simple example of how is done:

http://jsfiddle.net/7Waxv/2/

Tuesday, October 7, 2014

Share data among controllers

Use $ rootScope

var app = angular.module('mymodule',[]);
app.controller('Ctrl1', ['$scope','$rootScope',
  function($scope, $rootScope) {
    $rootScope.showBanner = true;
}]);

app.controller('Ctrl2', ['$scope','$rootScope',
  function($scope, $rootScope) {
    $rootScope.showBanner = false;
}]);

Source:
http://stackoverflow.com/questions/20181323/passing-data-between-controllers-in-angular-js