@ovh-ux/ng-ovh-doc-url
v2.1.2
Published
Easily create links or get urls to 2api endpoint which redirects to documentation systems
Downloads
91
Readme
ng-ovh-doc-url
Easily create links or get urls to 2api endpoint which redirects to documentation systems (Content manager and docs.ovh.com)
Install
$ yarn add @ovh-ux/ng-ovh-doc-url
Usage
import angular from 'angular';
import ngOvhDocUrl from '@ovh-ux/ng-ovh-doc-url';
angular
.module('myApp', [ngOvhDocUrl])
.config(
/* @ngInject */ (ovhDocUrlProvider, TranslateServiceProvider) => {
// User locale configuration
ovhDocUrlProvider.setUserLocale(TranslateServiceProvider.getUserLocale());
// Url prefix for 2api
ovhDocUrlProvider.setUrlPrefix('/engine/2api');
},
)
.controller(
'MyController',
class {
/* @ngInject */
constructor(ovhDocUrl) {
this.ovhDocUrl = ovhDocUrl;
}
$onInit() {
this.url = this.ovhDocUrl.getDocUrl('g1769.creating_ssh_keys');
}
},
);
<ovh-doc-url data-doc-id="g1769.creating_ssh_keys">My link</ovh-doc-url>
<ovh-doc-url data-doc-id="cloud/dedicated/ovh-ssh-key">My link</ovh-doc-url>
Test
$ yarn test
Contributing
Always feel free to help out! Whether it's filing bugs and feature requests or working on some of the open issues, our contributing guide will help get you started.
License
BSD-3-Clause © OVH SAS