'ng-attr interpolation not working when loading web components with esm-es5/loader.js
I'm using angular 1.5.9 and a component library made with web components.
When loading the library using unpkg, everything works fine:
<script src="https://unpkg.com/@postnord/[email protected]/umd/pn-marketweb-init.js?inject=cssoverride"></script>
// directive.html
<pn-marketweb-siteheader>
<div slot="toprightend" ng-click="ctrl.sayHello()">
{{1 + 1}}
</div>
</div>
// Renders as 2
But when putting the component library in a folder in the project and loading it with an esm-es5/loader.js the ng-click still works but the {{ 1 + 1 }} is not getting interpolated.
import './node_modules/@webcomponents/custom-elements/src/native-shim.js';
import { defineCustomElements as defineCustomElementsMarketWeb } from './node_modules/@postnord/pn-marketweb-components/esm-es5/loader.js';
import { defineCustomElements } from './node_modules/@postnord/web-components/esm-es5/loader.js';
// directive.html
<pn-marketweb-siteheader>
<div slot="toprightend" ng-click="ctrl.sayHello()">
{{1 + 1}}
</div>
</div>
// Renders as {{ 1 + 1 }} (but ng-click still works)
I'm usually not working with angular.
- Is there a typical problem that can lead to
ng-clickworking but{{ ... }}andng-attrnot getting interpolated? - Are there known issues when using Angular (1.5.9) with web components or with esm-es5 loaders?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
