migrate from angularjs to native js