improve angularjs example