AngularJS: useful behaviors