How to passing service data to component?

Hi,

i am struggling to print response from service to “user.html” , could you help me to resolve this?

{
path: ‘/user/’,
componentUrl: ‘./pages/user.html’,
async: function (routeTo, routeFrom, resolve, reject) {
app.request.get(‘https://xxxx.com/fetchuserlist’, function (data) {
resolve({context: {users: data}}
);
});

 }      

},

{
  path: '/user/',
  async: function (routeTo, routeFrom, resolve, reject) {
    app.request.get('https://xxxx.com/fetchuserlist', function (data) {
      resolve(
        {componentUrl: './pages/user.html'},
        {context: {users: data}};
      );
    })
  },
},

Thanks. It working fine now.

I have another doubt the same page have infinite scroll to show same template with variable replacement. For this kind of scenario how to maintain single template for onload and scroll replacement.