Extract server and database manipulation code in angular to the separate models. Use strict mode in JS