@ovh-ux/ng-ovh-doc-url

2.1.1 • Public • Published

ng-ovh-doc-url

Easily create links or get urls to 2api endpoint which redirects to documentation systems (Content manager and docs.ovh.com)

npm version Downloads Dependencies Dev Dependencies

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

Dependencies (2)

Dev Dependencies (1)

Package Sidebar

Install

npm i @ovh-ux/ng-ovh-doc-url

Weekly Downloads

2

Version

2.1.1

License

BSD-3-Clause

Unpacked Size

26.6 kB

Total Files

14

Last publish

Collaborators

  • jisay
  • blary_jp
  • antleblanc
  • cbourgois
  • ovh-ux-cds
  • lizardk
  • ovh
  • marie-j