How to use content in resolve (async route)

F7 version 5.3.2


i use route async to get simple html via ajax request.
I don’t know how to use my data response in content property of resolve.

I try:

content: “.page-temp”
content: $$(".page-temp")

This is my route

    path: '/ordini/:tipo/:id/',
    name: 'dettaglioOrdine',
    async: function (routeTo, routeFrom, resolve, reject) {
      if (isAutenticato) {
        var router = this;
        var app =;     ;
        var sTipo = routeTo.params.tipo
        var iID =
          url: urlAPI + "/ordini/ordine/?id=" + iID + "&p=" + sTipo,
          xhrFields: {withCredentials: true},           
          method: 'GET',
          crossDomain: true,
          timeout: 2000,
          processData: true,
          dataType: 'text',
          beforeSend: function (xhr) { 
              xhr.setRequestHeader("Authorization", 'Bearer ' + appToken);
          error: function (xhr, status) {
            alert('Si è verificato un errore di comunicazione, riprovare');
          success: function (data, status, xhr) {
            $$('.navbar-inner .title').text('Dettaglio ordine');
              content: ".page-temp"
                context: {
                  cache: false,
                  xhrCache: false,


Take a look at the async features.

  async: function (routeTo, routeFrom, resolve, reject) {
          // Requested route
          // Get external data and return template7 template
'http://some-endpoint/', function (data) {
              // How and what to load: template
                template: '<div class="page">{{users}}</div>'
              // Custom template context
                context: {
                  users: data,

Thanks for your answer,
but my problem is in the content, not the context.

parameters object - object with resolved route content. Must contain one of url , content , template , templateUrl , component or componentUrl properties

when you want to do it, it will do your job to bring it with ajax

    template: result  // template you take with ajax
1 Like

If you are using content?! then content suppose to receive full HTML content of the page, like

content: `<div class="page">....</div>`

Thanks! I resolve add the code