angular-mount-react
v1.0.0
Published
Angular directive to integrate React components into angular application
Downloads
4
Readme
Angular mount React
Angular directive to integrate React components into angular application
How to use
const HelloComponent = ({ name, upperCase }) => {
return (
<span>
{upperCase(`Hello ${name}`)}
</span>
);
};
angular.module('app', [mountReact().name])
.factory('upperCase', () => {
return (string) => string.toUpperCase()
})
.component('hello', {
template: `
<mount-react component="$ctrl.component" props="{name: $ctrl.name}" inject="['upperCase']">
</mount-react>
`,
controller: () => {
return {
component: HelloComponent
};
},
bindings: {
name: '@'
}
});