clone code from jquery to angular