UNPKG

carbon-components-angular

Version:
1,182 lines (1,001 loc) 46.1 kB
<!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>carbon-components-angular documentation</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="../images/favicon.ico"> <link rel="stylesheet" href="../styles/style.css"> <link rel="stylesheet" href="../styles/dark.css"> <style> footer.carbon { position: absolute; bottom: 0; width: 100%; z-index: 9999; } #root > div { /* * Subtracting the height of the footer to prevent * overlaying the footer ontop of content */ height: calc(100vh - 48px); } </style> </head> <body> <script> // Blocking script to avoid flickering dark mode // Dark mode toggle button var useDark = window.matchMedia('(prefers-color-scheme: dark)'); var darkModeState = useDark.matches; var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input'); var $darkModeToggles = document.querySelectorAll('.dark-mode-switch'); var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state'); function checkToggle(check) { for (var i = 0; i < $darkModeToggleSwitchers.length; i++) { $darkModeToggleSwitchers[i].checked = check; } } function toggleDarkMode(state) { if (window.localStorage) { localStorage.setItem('compodoc_darkmode-state', state); } checkToggle(state); const hasClass = document.body.classList.contains('dark'); if (state) { for (var i = 0; i < $darkModeToggles.length; i++) { $darkModeToggles[i].classList.add('dark'); } if (!hasClass) { document.body.classList.add('dark'); } } else { for (var i = 0; i < $darkModeToggles.length; i++) { $darkModeToggles[i].classList.remove('dark'); } if (hasClass) { document.body.classList.remove('dark'); } } } useDark.addEventListener('change', function (evt) { toggleDarkMode(evt.matches); }); if (darkModeStateLocal) { darkModeState = darkModeStateLocal === 'true'; } toggleDarkMode(darkModeState); </script> <div class="navbar navbar-default navbar-fixed-top d-md-none p-0"> <div class="d-flex"> <a href="../" class="navbar-brand">carbon-components-angular documentation</a> <button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button> </div> </div> <div class="xs-menu menu" id="mobile-menu"> <div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu> </div> <div class="container-fluid main"> <div class="row main"> <div class="d-none d-md-block menu"> <compodoc-menu mode="normal"></compodoc-menu> </div> <!-- START CONTENT --> <div class="content injectable"> <div class="content-data"> <ol class="breadcrumb"> <li class="breadcrumb-item">Injectables</li> <li class="breadcrumb-item" >NotificationService</li> </ol> <ul class="nav nav-tabs" role="tablist"> <li class="nav-item"> <a href="#info" class="nav-link" class="nav-link active" role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a> </li> <li class="nav-item"> <a href="#source" class="nav-link" role="tab" id="source-tab" data-bs-toggle="tab" data-link="source">Source</a> </li> </ul> <div class="tab-content"> <div class="tab-pane fade active in" id="info"> <p class="comment"> <h3>File</h3> </p> <p class="comment"> <code>src/notification/notification.service.ts</code> </p> <p class="comment"> <h3>Description</h3> </p> <p class="comment"> <p>Provides a way to use the notification component.</p> <p>Notifications are displayed toward the top of the UI and do not interrupt the user’s work.</p> </p> <section data-compodoc="block-index"> <h3 id="index">Index</h3> <table class="table table-sm table-bordered index-table"> <tbody> <tr> <td class="col-md-4"> <h6><b>Properties</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <span class="modifier">Public</span> <a href="#notificationRefs" >notificationRefs</a> </li> <li> <span class="modifier">Public</span> <a href="#onClose" >onClose</a> </li> </ul> </td> </tr> <tr> <td class="col-md-4"> <h6><b>Methods</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <a href="#close" >close</a> </li> <li> <a href="#getSmartTimeout" >getSmartTimeout</a> </li> <li> <a href="#ngOnDestroy" >ngOnDestroy</a> </li> <li> <a href="#showActionable" >showActionable</a> </li> <li> <a href="#showNotification" >showNotification</a> </li> <li> <a href="#showToast" >showToast</a> </li> </ul> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-constructor"> <h3 id="constructor">Constructor</h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <code>constructor(injector: Injector, viewContainer: ViewContainerRef, ngZone: NgZone)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="29" class="link-to-prism">src/notification/notification.service.ts:29</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Constructs Notification Service</p> </div> <div> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Type</td> <td>Optional</td> </tr> </thead> <tbody> <tr> <td>injector</td> <td> <code>Injector</code> </td> <td> No </td> </tr> <tr> <td>viewContainer</td> <td> <code>ViewContainerRef</code> </td> <td> No </td> </tr> <tr> <td>ngZone</td> <td> <code>NgZone</code> </td> <td> No </td> </tr> </tbody> </table> </div> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-methods"> <h3 id="methods"> Methods </h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="close"></a> <span class="name"> <span ><b>close</b></span> <a href="#close"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>close(notificationRef: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="144" class="link-to-prism">src/notification/notification.service.ts:144</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Programatically closes notification based on <code>notificationRef</code>.</p> </div> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Type</td> <td>Optional</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td>notificationRef</td> <td> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code> </td> <td> No </td> <td> <p><code>ComponentRef</code> of a notification or <code>Notification</code> component you wish to close</p> </td> </tr> </tbody> </table> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code> </div> <div class="io-description"> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="getSmartTimeout"></a> <span class="name"> <span ><b>getSmartTimeout</b></span> <a href="#getSmartTimeout"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>getSmartTimeout(notificationObj)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="167" class="link-to-prism">src/notification/notification.service.ts:167</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Calculates the amount of time user needs to read the message in the notification.</p> <p>In addition to <code>type</code> and <code>message</code> members, use <code>duration</code> member to add some extra time (in ms) to timeout if you need to.</p> </div> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Optional</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td>notificationObj</td> <td> No </td> <td> <p>Same object used to instantiate notification.</p> <p>In addition to <code>type</code> and <code>message</code> members, use <code>duration</code> member to add some extra time (in ms) to timeout if you need to.</p> </td> </tr> </tbody> </table> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code> </div> <div class="io-description"> <p>calculated timeout (in ms) for smart notification</p> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="ngOnDestroy"></a> <span class="name"> <span ><b>ngOnDestroy</b></span> <a href="#ngOnDestroy"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>ngOnDestroy()</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="208" class="link-to-prism">src/notification/notification.service.ts:208</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>OnDestroy hook.</p> <p>Destroys all living notifications it is responsible for.</p> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="showActionable"></a> <span class="name"> <span ><b>showActionable</b></span> <a href="#showActionable"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>showActionable(notificationObj: <a href="../interfaces/ActionableContent.html" target="_self">ActionableContent</a>, notificationComp)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="135" class="link-to-prism">src/notification/notification.service.ts:135</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Type</td> <td>Optional</td> <td>Default value</td> </tr> </thead> <tbody> <tr> <td>notificationObj</td> <td> <code><a href="../interfaces/ActionableContent.html" target="_self" >ActionableContent</a></code> </td> <td> No </td> <td> </td> </tr> <tr> <td>notificationComp</td> <td> </td> <td> No </td> <td> <code>ActionableNotification</code> </td> </tr> </tbody> </table> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code> </div> <div class="io-description"> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="showNotification"></a> <span class="name"> <span ><b>showNotification</b></span> <a href="#showNotification"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>showNotification(notificationObj: NotificationContent | ToastContent | ActionableContent, notificationComp)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="70" class="link-to-prism">src/notification/notification.service.ts:70</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Shows the notification based on the <code>notificationObj</code>.</p> <p><strong>Members:</strong></p> <ul> <li><code>type</code> can be one of <code>&quot;info&quot;</code>, <code>&quot;warning&quot;</code>, <code>&quot;danger&quot;</code>, <code>&quot;success&quot;</code></li> <li><code>message</code> is message for notification to display</li> <li><code>target</code> is css selector defining an element to append notification to. If not provided, <code>showNotification()</code> creates a place for the notification in <code>body</code></li> <li><code>duration</code> is number of ms to close the notification after. If used in combination with <code>smart</code>, it&#39;s added to the calculated timeout</li> <li><code>smart</code>, set to <code>true</code> if you want to use smart notification.</li> </ul> <p><strong>Example:</strong></p> <b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">// Info notification, saying &quot;Sample message.&quot; added to the element with id notification-container // uses smart timeout with added duration of 1 second. { type: &quot;info&quot;, message: &quot;Sample message.&quot;, target: &quot;#notification-container&quot;, duration: 1000, smart: true }</code></pre></div></div> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Type</td> <td>Optional</td> <td>Default value</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td>notificationObj</td> <td> <code>NotificationContent | ToastContent | ActionableContent</code> </td> <td> No </td> <td> </td> <td> <p>Can have <code>type</code>, <code>message</code>, <code>target</code>, <code>duration</code> and <code>smart</code> members.</p> <p><strong>Members:</strong></p> <ul> <li><code>type</code> can be one of <code>&quot;info&quot;</code>, <code>&quot;warning&quot;</code>, <code>&quot;danger&quot;</code>, <code>&quot;success&quot;</code></li> <li><code>message</code> is message for notification to display</li> <li><code>target</code> is css selector defining an element to append notification to. If not provided, <code>showNotification()</code> creates a place for the notification in <code>body</code></li> <li><code>duration</code> is number of ms to close the notification after. If used in combination with <code>smart</code>, it&#39;s added to the calculated timeout</li> <li><code>smart</code>, set to <code>true</code> if you want to use smart notification.</li> </ul> <p><strong>Example:</strong></p> <b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">// Info notification, saying &quot;Sample message.&quot; added to the element with id notification-container // uses smart timeout with added duration of 1 second. { type: &quot;info&quot;, message: &quot;Sample message.&quot;, target: &quot;#notification-container&quot;, duration: 1000, smart: true }</code></pre></div> </td> </tr> <tr> <td>notificationComp</td> <td> </td> <td> No </td> <td> <code>Notification</code> </td> <td> <p>If provided, used to resolve component factory</p> </td> </tr> </tbody> </table> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code> </div> <div class="io-description"> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="showToast"></a> <span class="name"> <span ><b>showToast</b></span> <a href="#showToast"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>showToast(notificationObj: NotificationContent | ToastContent, notificationComp)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="131" class="link-to-prism">src/notification/notification.service.ts:131</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Type</td> <td>Optional</td> <td>Default value</td> </tr> </thead> <tbody> <tr> <td>notificationObj</td> <td> <code>NotificationContent | ToastContent</code> </td> <td> No </td> <td> </td> </tr> <tr> <td>notificationComp</td> <td> </td> <td> No </td> <td> <code>Toast</code> </td> </tr> </tbody> </table> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code> </div> <div class="io-description"> </div> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-properties"> <h3 id="inputs"> Properties </h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="notificationRefs"></a> <span class="name"> <span class="modifier">Public</span> <span ><b>notificationRefs</b></span> <a href="#notificationRefs"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <i>Default value : </i><code>new Array&lt;ComponentRef&lt;any&gt;&gt;()</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="28" class="link-to-prism">src/notification/notification.service.ts:28</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>An array containing <code>ComponentRef</code>s to all the notifications this service instance is responsible for.</p> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="onClose"></a> <span class="name"> <span class="modifier">Public</span> <span ><b>onClose</b></span> <a href="#onClose"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code>EventEmitter&lt;any&gt;</code> </td> </tr> <tr> <td class="col-md-4"> <i>Default value : </i><code>new EventEmitter()</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="29" class="link-to-prism">src/notification/notification.service.ts:29</a></div> </td> </tr> </tbody> </table> </section> </div> <div class="tab-pane fade tab-source-code" id="source"> <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { ComponentRef, EventEmitter, Injectable, OnDestroy, NgZone, ViewContainerRef, Injector } from &quot;@angular/core&quot;; import { NotificationContent, ToastContent, ActionableContent } from &quot;./notification-content.interface&quot;; import { Notification } from &quot;./notification.component&quot;; import { Toast } from &quot;./toast.component&quot;; import { ActionableNotification } from &quot;./actionable-notification.component&quot;; /** * Provides a way to use the notification component. * * Notifications are displayed toward the top of the UI and do not interrupt the user’s work. */ @Injectable() export class NotificationService implements OnDestroy { /** * An array containing &#x60;ComponentRef&#x60;s to all the notifications this service instance * is responsible for. * */ public notificationRefs &#x3D; new Array&lt;ComponentRef&lt;any&gt;&gt;(); public onClose: EventEmitter&lt;any&gt; &#x3D; new EventEmitter(); /** * Constructs Notification Service */ constructor( protected injector: Injector, protected viewContainer: ViewContainerRef, protected ngZone: NgZone ) {} /** * Shows the notification based on the &#x60;notificationObj&#x60;. * * @param notificationObj Can have &#x60;type&#x60;, &#x60;message&#x60;, &#x60;target&#x60;, &#x60;duration&#x60; and &#x60;smart&#x60; members. * * **Members:** * * * &#x60;type&#x60; can be one of &#x60;&quot;info&quot;&#x60;, &#x60;&quot;warning&quot;&#x60;, &#x60;&quot;danger&quot;&#x60;, &#x60;&quot;success&quot;&#x60; * * &#x60;message&#x60; is message for notification to display * * &#x60;target&#x60; is css selector defining an element to append notification to. If not provided, * &#x60;showNotification()&#x60; creates a place for the notification in &#x60;body&#x60; * * &#x60;duration&#x60; is number of ms to close the notification after. If used in combination with &#x60;smart&#x60;, * it&#x27;s added to the calculated timeout * * &#x60;smart&#x60;, set to &#x60;true&#x60; if you want to use smart notification. * * **Example:** * &#x60;&#x60;&#x60;typescript * // Info notification, saying &quot;Sample message.&quot; added to the element with id notification-container * // uses smart timeout with added duration of 1 second. * { * type: &quot;info&quot;, * message: &quot;Sample message.&quot;, * target: &quot;#notification-container&quot;, * duration: 1000, * smart: true * } * &#x60;&#x60;&#x60; * * @param [notificationComp&#x3D;Notification] If provided, used to resolve component factory */ showNotification( notificationObj: NotificationContent | ToastContent | ActionableContent, notificationComp &#x3D; Notification ) { const notificationRef &#x3D; this.viewContainer.createComponent(notificationComp); notificationRef.instance.notificationObj &#x3D; notificationObj; this.notificationRefs.push(notificationRef); this.onClose &#x3D; notificationRef.instance.close; if (notificationObj.target) { document.querySelector(notificationObj.target).appendChild(notificationRef.location.nativeElement); } else { let body &#x3D; document.querySelector(&quot;body&quot;); // get or create a container for alert list let notificationClassName &#x3D; &quot;notification-overlay&quot;; let notificationList &#x3D; body.querySelector(&#x60;.${notificationClassName}&#x60;); if (!notificationList) { notificationList &#x3D; document.createElement(&quot;div&quot;); notificationList.className &#x3D; notificationClassName; body.appendChild(notificationList); } // add the notification to the top of the list if (notificationList.firstChild) { notificationList.insertBefore(notificationRef.location.nativeElement, notificationList.firstChild); } else { notificationList.appendChild(notificationRef.location.nativeElement); } } if (notificationObj.duration &amp;&amp; notificationObj.duration &gt; 0) { this.ngZone.runOutsideAngular(() &#x3D;&gt; { setTimeout(() &#x3D;&gt; { this.ngZone.run(() &#x3D;&gt; { this.close(notificationRef); }); }, notificationObj.duration); }); } if (notificationObj.smart) { this.ngZone.runOutsideAngular(() &#x3D;&gt; { // let it disappear after calculated timeout setTimeout(() &#x3D;&gt; { this.ngZone.run(() &#x3D;&gt; { this.close(notificationRef); }); }, this.getSmartTimeout(notificationObj)); }); } this.onClose.subscribe(() &#x3D;&gt; { this.close(notificationRef); }); notificationRef.instance.componentRef &#x3D; notificationRef; return notificationRef.instance; } showToast(notificationObj: NotificationContent | ToastContent, notificationComp &#x3D; Toast) { return this.showNotification(notificationObj, notificationComp as any); } showActionable(notificationObj: ActionableContent, notificationComp &#x3D; ActionableNotification) { return this.showNotification(notificationObj, notificationComp as any); } /** * Programatically closes notification based on &#x60;notificationRef&#x60;. * * @param notificationRef &#x60;ComponentRef&#x60; of a notification or &#x60;Notification&#x60; component you wish to close */ close(notificationRef: any) { if (notificationRef) { if (notificationRef instanceof Notification) { this.close(notificationRef.componentRef); } else { notificationRef.destroy(); const index &#x3D; this.notificationRefs.indexOf(notificationRef); if (index !&#x3D;&#x3D; -1) { this.notificationRefs.splice(index, 1); } } } } /** * Calculates the amount of time user needs to read the message in the notification. * * @param notificationObj Same object used to instantiate notification. * * In addition to &#x60;type&#x60; and &#x60;message&#x60; members, use &#x60;duration&#x60; member to add * some extra time (in ms) to timeout if you need to. * @returns calculated timeout (in ms) for smart notification */ getSmartTimeout(notificationObj): number { // calculate timeout let timeout &#x3D; 600; // start with reaction time // custom duration timeout +&#x3D; notificationObj.duration || 0; // message type switch (notificationObj.type) { case &quot;info&quot;: case &quot;info-square&quot;: case &quot;success&quot;: default: { break; } case &quot;danger&quot;: { timeout +&#x3D; 3000; break; } case &quot;warning&quot;: case &quot;warning-alt&quot;: { timeout +&#x3D; 1500; break; } } // message length // average reader reads around 200 words per minute, or it takes them ~0.3s per word // let&#x27;s use 1.5 factor for below average speed readers and have 0.45s per word let wordCount &#x3D; notificationObj.message.trim().split(/\s+/).length; timeout +&#x3D; wordCount * 450; return timeout; } /** * OnDestroy hook. * * Destroys all living notifications it is responsible for. * */ ngOnDestroy() { this.notificationRefs.forEach((ref) &#x3D;&gt; { ref.destroy(); }); } } </code></pre> </div> </div> </div><div class="search-results"> <div class="has-results"> <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1> <ul class="search-results-list"></ul> </div> <div class="no-results"> <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1> </div> </div> </div> <!-- END CONTENT --> </div> </div> <label class="dark-mode-switch"> <input type="checkbox"> <span class="slider"> <svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg"> <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path> </svg> </span> </label> <script> var COMPODOC_CURRENT_PAGE_DEPTH = 1; var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable'; var COMPODOC_CURRENT_PAGE_URL = 'NotificationService.html'; var MAX_SEARCH_RESULTS = 15; </script> <script> $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input'); checkToggle(darkModeState); if ($darkModeToggleSwitchers.length > 0) { for (var i = 0; i < $darkModeToggleSwitchers.length; i++) { $darkModeToggleSwitchers[i].addEventListener('change', function (event) { darkModeState = !darkModeState; toggleDarkMode(darkModeState); }); } } </script> <script src="../js/libs/custom-elements.min.js"></script> <script src="../js/libs/lit-html.js"></script> <script src="../js/menu-wc.js" defer></script> <script nomodule src="../js/menu-wc_es5.js" defer></script> <script src="../js/libs/bootstrap-native.js"></script> <script src="../js/libs/es6-shim.min.js"></script> <script src="../js/libs/EventDispatcher.js"></script> <script src="../js/libs/promise.min.js"></script> <script src="../js/libs/zepto.min.js"></script> <script src="../js/compodoc.js"></script> <script src="../js/tabs.js"></script> <script src="../js/menu.js"></script> <script src="../js/libs/clipboard.min.js"></script> <script src="../js/libs/prism.js"></script> <script src="../js/sourceCode.js"></script> <script src="../js/search/search.js"></script> <script src="../js/search/lunr.min.js"></script> <script src="../js/search/search-lunr.js"></script> <script src="../js/search/search_index.js"></script> <script src="../js/lazy-load-graphs.js"></script> <footer class="carbon"> <dds-footer-container key="footer" disable-locale-button="true" size="micro" /> </footer> <script key="8" type="module" src="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/footer.min.js"> </script> <!-- Storybook override --> <script> document.title = "Carbon Components Angular"; </script> <script src="//1.www.s81c.com/common/stats/ibm-common.js" type="text/javascript" async="async"> </script> </body> </html>