Convert to AngularJS