1.2.19 • Published 11 months ago

@anjuna/angular-core v1.2.19

Weekly downloads
668
License
MIT
Repository
-
Last release
11 months ago

@anjuna/angular-core

The @anjuna/angular-core module is a set of Angular-specific wrappers and helpers to plug the core component library into Angular's APIs and patterns.

Getting Started

npm install @anjuna/core @anjuna/angular-core

Include the Theme

The best way to add the theme is by including the theme.css files from @anjuna/theme in your styles.scss. Icons are best added by CDN url in your styles.scss.

@import '~@anjuna/theme/dist/css/theme.css';

Note: the polyfill for CSS variables does not work with dynamically loaded imports. For CSS variables to work in IE, the theme needs to be part of your application's compiled style.

Include the Web Components

To use the web components in your application, you first need to include them. Depending on your integration, there are a couple ways to do this. The preferred way to add web component libraries to Angular applications is to do so when bootstrapping the app. Update your application's main.ts to add the following functionality:

import {enableProdMode} from '@angular/core';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
// import the loader and alias it so it won't conflict with other libraries
import {applyPolyfills, defineCustomElements as defineAnjunaElements} from '@anjuna/core/loader';

import {AppModule} from '@app/app.module';
import {environment} from '@env/environment';

if (environment.production) {
    enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
    .catch(err => console.log(err));

applyPolyfills().then(() => {
    defineAnjunaElements(window);
    // define any other web components within this block also
});
Custom Elements Schema

By default, Angular does not like it when it doesn't recognize a component tag and will throw an error. To configure Angular modules to tell them we're using custom elements, we need to add the CUSTOM_ELEMENT_SCHEMA schema to modules that will be making use of them.

import {NgModule, CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';

@NgModule({
    declarations: [
        // removed for brevity
    ],
    imports: [
        // removed for brevity
    ],
    schemas: [
        // the important part
        CUSTOM_ELEMENTS_SCHEMA
    ],
    bootstrap: [AppComponent]
})
export class AppModule {}

Include the Module

Once installed, you can import the module into any Angular module you need it.

import {NgModule, CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import {AnjunaCoreModule} from '@anjuna/angular-core';

@NgModule({
    imports: [
        // Other imports
        AnjunaCoreModule
    ],
    declarations: [
        // application components
    ],
    schemas: [
        CUSTOM_ELEMENTS_SCHEMA
    ]
})
export class MyModule {}
1.2.19

11 months ago

1.2.18

1 year ago

1.2.17

2 years ago

1.2.16

2 years ago

1.2.15

2 years ago

1.2.14

2 years ago

1.2.13

2 years ago

1.2.12

2 years ago

1.2.7

2 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

1.0.0-rc.72

3 years ago

1.0.0-rc.71

3 years ago

1.0.0-rc.70

3 years ago

1.0.0-rc.68

3 years ago

1.0.0-rc.69

3 years ago

1.0.0-rc.67

3 years ago

1.0.0-rc.65

3 years ago

1.0.0-rc.60

3 years ago

1.0.0-rc.59

3 years ago

1.0.0-rc.64

3 years ago

1.0.0-rc.63

3 years ago

1.0.0-rc.54

3 years ago

1.0.0-rc.53

3 years ago

1.0.0-rc.38

3 years ago

1.0.0-rc.37

3 years ago

1.0.0-rc.36

3 years ago

1.0.0-rc.35

3 years ago

1.0.0-rc.34

3 years ago

1.0.0-rc.33

3 years ago

1.0.0-rc.32

3 years ago

1.0.0-rc.31

3 years ago

1.0.0-rc.30

3 years ago

1.0.0-rc.29

3 years ago

1.0.0-rc.28

3 years ago

1.0.0-rc.26

3 years ago

1.0.0-rc.25

3 years ago

1.0.0-rc.24

3 years ago

1.0.0-rc.23

3 years ago

1.0.0-rc.22

3 years ago

1.0.0-rc.21

3 years ago

1.0.0-rc.20

3 years ago

1.0.0-rc.19

3 years ago

1.0.0-rc.18

3 years ago

1.0.0-rc.17

3 years ago

1.0.0-rc.16

3 years ago

1.0.0-rc.15

3 years ago

1.0.0-rc.14

3 years ago

1.0.0-rc.13

3 years ago

1.0.0-rc.12

3 years ago

1.0.0-rc.11

3 years ago

1.0.0-rc.10

3 years ago

1.0.0-rc.9

3 years ago

1.0.0-rc.8

3 years ago

1.0.0-rc.7

3 years ago

1.0.0-rc.6

3 years ago

1.0.0-rc.5

3 years ago

1.0.0-rc.4

3 years ago

1.0.0-rc.3

3 years ago

1.0.0-rc.2

3 years ago

1.0.0-rc.1

3 years ago

1.0.0-rc.0

3 years ago

1.0.0-beta.17

3 years ago

1.0.0-beta.16

3 years ago

1.0.0-beta.15

3 years ago

1.0.0-beta.14

3 years ago

1.0.0-beta.13

3 years ago

1.0.0-beta.12

3 years ago

1.0.0-beta.11

3 years ago

1.0.0-beta.10

3 years ago

1.0.0-beta.9

3 years ago

1.0.0-beta.8

3 years ago

1.0.0-beta.7

3 years ago

1.0.0-beta.5

3 years ago

1.0.0-beta.4

3 years ago

1.0.0-beta.3

3 years ago

1.0.0-beta.2

3 years ago

1.0.0-beta.1

3 years ago

1.0.0-beta.0

3 years ago

1.0.0-alpha.36

3 years ago

1.0.0-alpha.34

3 years ago

1.0.0-alpha.33

3 years ago

1.0.0-alpha.32

3 years ago

1.0.0-alpha.31

3 years ago

1.0.0-alpha.30

3 years ago

1.0.0-alpha.29

3 years ago

1.0.0-alpha.28

3 years ago

1.0.0-alpha.27

3 years ago

1.0.0-alpha.26

3 years ago

1.0.0-alpha.25

3 years ago

1.0.0-alpha.24

3 years ago

1.0.0-alpha.23

3 years ago

1.0.0-alpha.22

3 years ago

1.0.0-alpha.21

3 years ago

1.0.0-alpha.20

3 years ago

1.0.0-alpha.19

3 years ago

1.0.0-alpha.16

3 years ago

1.0.0-alpha.15

3 years ago

1.0.0-alpha.14

3 years ago

1.0.0-alpha.13

3 years ago

1.0.0-alpha.12

3 years ago

1.0.0-alpha.11

3 years ago

1.0.0-alpha.10

3 years ago

1.0.0-alpha.9

3 years ago

1.0.0-alpha.8

3 years ago

1.0.0-alpha.7

3 years ago

1.0.0-alpha.6

3 years ago

1.0.0-alpha.4

3 years ago

1.0.0-alpha.3

3 years ago

1.0.0-alpha.2

3 years ago

1.0.0-alpha.1

3 years ago

1.0.0-alpha.0

4 years ago

1.0.0-preview.98

4 years ago

1.0.0-preview.97

4 years ago

1.0.0-preview.96

4 years ago

1.0.0-preview.95

4 years ago

1.0.0-preview.94

4 years ago

1.0.0-preview.93

4 years ago

1.0.0-preview.92

4 years ago

1.0.0-preview.91

4 years ago

1.0.0-preview.90

4 years ago

1.0.0-preview.89

4 years ago

1.0.0-preview.88

4 years ago

1.0.0-preview.87

4 years ago

1.0.0-preview.86

4 years ago

1.0.0-preview.85

4 years ago

1.0.0-preview.84

4 years ago

1.0.0-preview.83

4 years ago

1.0.0-preview.82

4 years ago

1.0.0-preview.81

4 years ago

1.0.0-preview.80

4 years ago

1.0.0-preview.79

4 years ago

1.0.0-preview.78

4 years ago

1.0.0-preview.77

4 years ago

1.0.0-preview.76

4 years ago

1.0.0-preview.75

4 years ago

1.0.0-preview.74

4 years ago

1.0.0-preview.73

4 years ago

1.0.0-preview.72

4 years ago

1.0.0-preview.71

4 years ago

1.0.0-preview.70

4 years ago

1.0.0-preview.69

4 years ago

1.0.0-preview.68

4 years ago

1.0.0-preview.67

4 years ago

1.0.0-preview.66

4 years ago

1.0.0-preview.65

4 years ago

1.0.0-preview.64

4 years ago

1.0.0-preview.63

4 years ago

1.0.0-preview.62

4 years ago

1.0.0-preview.61

4 years ago

1.0.0-preview.60

4 years ago

1.0.0-preview.59

4 years ago

1.0.0-preview.58

4 years ago

1.0.0-preview.57

4 years ago

1.0.0-preview.56

4 years ago

1.0.0-preview.55

4 years ago

1.0.0-preview.54

4 years ago

1.0.0-preview.53

4 years ago

1.0.0-preview.52

4 years ago

1.0.0-preview.51

4 years ago

1.0.0-preview.50

4 years ago

1.0.0-preview.49

4 years ago

1.0.0-preview.48

4 years ago

1.0.0-preview.47

4 years ago

1.0.0-preview.46

4 years ago

1.0.0-preview.45

4 years ago

1.0.0-preview.44

4 years ago

1.0.0-preview.43

4 years ago

1.0.0-preview.42

4 years ago

1.0.0-preview.41

4 years ago

1.0.0-preview.40

4 years ago

1.0.0-preview.39

4 years ago

1.0.0-preview.38

4 years ago

1.0.0-preview.37

4 years ago

1.0.0-preview.36

4 years ago

1.0.0-preview.35

4 years ago

1.0.0-preview.32

4 years ago

1.0.0-preview.31

4 years ago

1.0.0-preview.30

4 years ago

1.0.0-preview.27

4 years ago

1.0.0-preview.18

4 years ago

1.0.0-preview.9

4 years ago

1.0.0-preview.6

4 years ago

1.0.0-preview.4

4 years ago

0.0.0

4 years ago