from angularjs to jquery (too much problem on loops)