Replacing all the direct DOM manipulation with ng attrs