async ensureTemplate(routeId) {
    if (!routeId || !this.routeIds.has(routeId))
      throw new Error(`[uibrouter:ensureTemplate] No valid route id provided. Route ID: '${routeId}'`);
    let rContent = document.querySelector(`#${routeId}`);
    if (!rContent) {
      const r = this.getRouteConfigById(routeId);
      if (r.type && r.type === "url") {
        let loadedEls;
        try {
          loadedEls = await this._loadExternal(r);
        } catch (e) {
          throw new Error(e.message, e);
        }
        if (!loadedEls)
          throw new Error(`[uibrouter:ensureTemplate] No route template found for route selector '#${routeId}'. Does the link url match a defined route id?`);
        this._appendExternalTemplates(loadedEls);
        rContent = document.querySelector(`#${routeId}`);
        if (!rContent)
          throw new Error(`[uibrouter:ensureTemplate] No valid route template found for external route selector '#${routeId}'`);
      } else {
        throw new Error(`[uibrouter:ensureTemplate] No route template found for internal route selector '#${routeId}'. Ensure that a template element with the matching ID exists in the HTML.`);
      }
    }
    return rContent;
  }
Async method to ensure that a template element exists for a given route id
 If route is external, will try to load if it doesn't exist.
All errors throw so make sure to try/catch calls to this method.
@param {string} routeId A single route ID
@returns {HTMLTemplateElement} A reference to the HTML Template element