Skip to content

Angular

Angular v2 and above

Eufemia may have an example code soon of using this React adapter solution, used by Microsoft.

Angular v1

Take a look at the Example App on GitHub using the dnb-ui-lib React Components. This is an Example App to demo the usage of dnb-ui-lib in Angular version 1.7.9. To power the React usage, You could use react2angular on NPM.

The syntax looks a like:

import { Button } from 'dnb-ui-lib'
import { bell_medium as Bell } from 'dnb-ui-lib/icons'
ngEufemiaButton.directive('eufemiaButtonDirective', () => {
return {
controller: $scope => {
$scope.text = 'Button'
$scope.icon = Bell
$scope.onClick = event => console.log('onClick', event)
},
template: /* @html */ `
<eufemia-button
text="text"
icon="icon"
on-click="onClick"
></eufemia-button>
`
}
})

Example

Have a look at this Angular 1 example app.

Screenshot

Screenshot of Angular Example App