[ML] Fixing detector help link in advanced wizard (#30641) (#30693)

* [ML] Fixing detector help link in advanced wizard

* tiny refactor
This commit is contained in:
James Gowdy 2019-02-11 22:09:38 +00:00 committed by GitHub
parent 421b47b413
commit 04b2be98fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,15 +29,20 @@ module.directive('mlDocumentationHelpLink', function () {
// metadata.branch corresponds to the version used in documentation links.
const version = metadata.branch;
const props = {
fullUrl: `${baseUrl}/guide/en/x-pack/${version}/${scope.uri}`,
label: scope.label
};
function renderReactComponent() {
ReactDOM.render(
React.createElement(DocumentationHelpLink, props),
element[0]
);
const props = {
fullUrl: `${baseUrl}/guide/en/x-pack/${version}/${scope.uri}`,
label: scope.label
};
ReactDOM.render(
React.createElement(DocumentationHelpLink, props),
element[0]
);
}
scope.$watch('uri', renderReactComponent);
}
};