This package has been deprecated

Author message:

Package no longer supported. Please upgrade to @norwegian/core-components.

@norwegian/norwegian-assets-ng
TypeScript icon, indicating that this package has built-in type declarations

4.18.3 • Public • Published

Angular assets for Norwegian

Component library to facilitate setup of new Norwegian projects. The library contains common UI building blocks for Norwegian sites. Like buttons, accordions, grid system, filter and search boxes, and so on.

Installation

In order to use components in your project, you have to install @norwegian/norwegian-assets-ng and @ngxs/store as a dependency of you project.

npm i @norwegian/norwegian-assets-ng
npm i @ngxs/store

When it's in there, you can start importing the stuff you need. Like this:

In app.module.ts:

import { ButtonModule } from '@norwegian/norwegian-assets-ng';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, ButtonModule],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}

In app.component.html:

<nas-button primary>Click me!</nas-button>

What about the SCSS?

The SCSS files for each component is compiled and injected into the component styles. In addition to this, the variables, mixins and such is included in the distributed package and is available for your project.

If you just want the styles:

@import '~@norwegian/norwegian-assets-ng/styles/index';

Exposing the assets

The styles refer til asset files like fonts and icons. These files are part of the distributed package and you need to expose them through the angular compiler in order for everything to come together. You do this through defining app assets in your .angular-cli.json file. Note that you need a license to use these assets in your site. These can be provided through NAB.

Add the following line to the apps.assets array:

{
  "glob": "**/*",
  "input": "./node_modules/@norwegian/norwegian-assets-ng/assets",
  "output": "./assets/"
}

Tech details

  • Angular 8+
  • AOT/JIT compatible component library
  • Styles and templates are inlined at build-time, no transpiling
  • Cherry-pick the modules you need. No need to include everything
  • Both components and modules are exposed, making it possible to compose new modules from the components

Adding your own component

Project is currenty not open source, and only developers which is a part of the Norwegian team can contribute with new components, features, bugfixes and patches. For the Norwegian team, please check out the internal documentation site for step-by-step introduction to the library.

Version History

See CHANGELOG for history

Readme

Keywords

none

Package Sidebar

Install

npm i @norwegian/norwegian-assets-ng

Weekly Downloads

645

Version

4.18.3

License

none

Unpacked Size

31 MB

Total Files

1145

Last publish

Collaborators

  • longtthnorwegian
  • nasdeploy
  • hflatland
  • clausous
  • tanu1208