The concepts are all spot on! 👏

You do however, make a mistake that so many others do as well: you’re calling functions on your template inputs! Only call functions in a template in response to events / outputs: like `(click)=”onClick()”`

Put a `console.log` in this function and see how often it gets called… such as whenever the mouse rolls over the component. 😬 The more you do this, the more it kills performance.

You can refactor this by changing the `flags` input to be a setter function, and have set a member variable with the results of ‘Object.keys(flags)’. It’ll only run when the input changes. 👍

Consulting Software Engineer and AWS Solutions Architect with over 34 years of experience. Specializing in AWS serverless application development and IoT.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store