Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“ie” Browser not display #133

Open
zhr85210078 opened this issue Jul 20, 2018 · 0 comments
Open

“ie” Browser not display #133

zhr85210078 opened this issue Jul 20, 2018 · 0 comments

Comments

@zhr85210078
Copy link

zhr85210078 commented Jul 20, 2018

Solution: /templates/index.hbs

`<script>
window.onload = function() {

if (typeof Object.assign != 'function') {
Object.assign = function(target) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}

target = Object(target);
for (var index = 1; index < arguments.length; index++) {
  var source = arguments[index];
  if (source != null) {
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        target[key] = source[key];
      }
    }
  }
}
return target;

};
}

// Build a system
const ui = SwaggerUIBundle(Object.assign({
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
}, {{{swaggerOptions}}}))

var oauthOptions = {{{oauthOptions}}};
if (oauthOptions) ui.initOAuth(oauthOptions)

window.ui = ui
}
</script>`

https://github.com/zhr85210078/hapi-swaggered-ui/edit/master/templates/index.hbs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant