
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@no-gravity-elements/angular-adapter
Advanced tools
This package generates an Angular module that can be imported in any Angular v17 project. It adds Angular directives for No Gravity Elements web components that provide typings and intellisense to the web components.
Install in your Angular repo.
npm i @no-gravity-elements/angular-adapter
Set as an external dependency in your angular.json.
"architect": {
"build": {
"options": {
"externalDependencies": ["@no-gravity-elements/angular-adapter"],
}
}
}
Add AngularAdapterModule to your ngModule imports or to your component imports.
@NgModule({
imports: [AngularAdapterModule],
})
@Component({
imports: [AngularAdapterModule],
})
Now you can consume no-gravity-elements in your Angular project.
Example usage:
import { Component } from '@angular/core';
import { AngularAdapterModule } from '@no-gravity-elements/angular-adapter';
import { TypographySizes } from '@no-gravity-elements/types';
import '@no-gravity-elements/typography';
@Component({
selector: 'app-root',
standalone: true,
imports: [AngularAdapterModule],
template: `
<nge-typography [size]="sizes.h1">
TEST
</nge-typography>
`,
styles: [],
})
export class AppComponent {
sizes = TypographySizes;
}
The Angular Adapter is automatically generated based on the existing components in the repository. The generate-adapter.js script will search each component's type declarations and will generate a directive for all components that have types. It will then generate a module that contains all the created directives.
To generate and build the adapter, run yarn build-angular-adapter
from the monorepo root folder or yarn build
from this package directory.
Publish job is set up to generate new version of adapter and will add all changes to the publish commit.
FAQs
No Gravity Element library adapter for Angular
We found that @no-gravity-elements/angular-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.