New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@oiz/stzh-components-angular

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oiz/stzh-components-angular

Angular component wrappers for @oiz/stzh-components

  • 3.0.0-beta1
  • npm
  • Socket score

Version published
Weekly downloads
93
increased by116.28%
Maintainers
3
Weekly downloads
 
Created
Source

@oiz/stzh-components-angular

Angular component wrappers for Design System Stadt Zürich with these benefits:

  • Angular component wrappers will be detached from change detection, preventing unnecessary repaints of your web component.
  • Web component events will be converted to RxJS observables to align with Angular's @Output() and will not emit across component boundaries.
  • Form control web components can be used as control value accessors with Angular's reactive forms or [ngModel].
  • It is not necessary to include the Angular CUSTOM_ELEMENTS_SCHEMA in all modules consuming your Stencil components.

Compatibility

Currently, only Angular 16.x.x is supported.

Installation

With the usage of @oiz/stzh-components-angular, you shouldn't install @oiz/stzh-components and you can ignore installation instructions for web components. Instead, do the following:

npm install @oiz/stzh-components-angular

Add the StzhComponentsAngularModule to your app.module.ts:

@NgModule({
  declarations: [AppComponent],
  imports: [
    ...
    StzhComponentsAngularModule
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}

Modify your angular.json:

{
    ...
    "projects": {
      "your-project": {
          ...
          "architect": {
              ...
              "options": {
                  ...
                  "assets": [
                      ...
                      <!-- ADD BELOW BLOCK -->
                      {
                        "glob": "**/*",
                        "input": "node_modules/@oiz/stzh-components/dist/stzh-components",
                        "output": "stzh-components-assets"
                      },
                      <!-- BLOCK FINISH -->
                  ],  
              },
              ...
          },
          ...
      }
    }
}

Add the following lines into the element of your index.html:

<head>
  ...
  
  <!-- async loading of font stylesheet -->
  <link rel="preload" as="style" href="stzh-components-assets/assets/fonts.css" />
  <link
    rel="stylesheet"
    href="stzh-components-assets/assets/fonts.css"
    media="print"
    onload="this.media='all'" />

  <!-- stylesheet with CSS properties/variables -->
  <link rel="stylesheet" href="stzh-components-assets/stzh-components.css" />

  <!-- OPTIONAL: include if you want to use the stzh-readspeaker component -->
  <link rel="stylesheet" href="stzh-components-assets/assets/vendors/readspeaker/ReadSpeakerClassic.css" media="print" onload="this.media='all'" />

  <!-- set path to translation and media files -->
  <script>
    window.stzhComponents = window.stzhComponents || {};
    window.stzhComponents.pathTranslations = 'stzh-components-assets/assets/i18n';
    window.stzhComponents.pathMedia = 'stzh-components-assets/assets/media';
  </script>
  
  ...
</head>

Add the following lines on top of the element of your index.html:

<body>
  <stzh-flyingfocus></stzh-flyingfocus>
  <stzh-icon-sprite></stzh-icon-sprite>
  <stzh-toastbar></stzh-toastbar>
  ...
</body>

If you use the stzh-readspeaker component, add the following at the end of the element of your index.html:

<body>
  ...
  <script src="stzh-components-assets/assets/vendors/readspeaker/ReadSpeaker.js?pids=embhl" type="text/javascript"></script>
  <script src="stzh-components-assets/assets/vendors/readspeaker/ReadSpeakerClassic.js" type="text/javascript"></script>
</body>

Types

To import any type used by stzh-components (e.g. StzhProgressbarDataItem, StzhCheckboxChangeEvent etc.), add:

import { StzhProgressbarDataItem, StzhCheckboxChangeEvent } from '@oiz/stzh-components/dist/types';

FAQs

Package last updated on 19 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc