What’s the difference between an Angular component and module

Components control views (html). They also communicate with other components and services to bring functionality to your app. Modules consist of one or more components. They do not control any html. Your modules declare which components can be used by components belonging to other modules, which classes will be injected by the dependency injector and … Read more

Node.js plans to support import/export ES6 (ECMAScript 2015) modules

Node.js 13.2.0 & Above Node.js 13.2.0 now supports ES Modules without a flag 🎉. However, the implementation is still marked as experimental so use in production with caution. To enable ECMAScript module (ESM) support in 13.2.0, add the following to your package.json: { “type”: “module” } All .js, .mjs (or files without an extension) will … Read more

How can I conditionally import an ES6 module?

We do have dynamic imports proposal now with ECMA. This is in stage 3. This is also available as babel-preset. Following is way to do conditional rendering as per your case. if (condition) { import(‘something’) .then((something) => { console.log(something.something); }); } This basically returns a promise. Resolution of promise is expected to have the module. … Read more

What exactly is Hot Module Replacement in Webpack?

First I want to note that Hot Module Replacement (HMR) is still an experimental feature. HMR is a way of exchanging modules in a running application (and adding/removing modules). You basically can update changed modules without a full page reload. Documentation Prerequirements: Using Plugins: https://webpack.js.org/concepts/plugins/ Code Splitting: https://webpack.js.org/guides/code-splitting/ webpack-dev-server: https://webpack.js.org/configuration/dev-server/ It’s not so much for … Read more

Defining private module functions in python

In Python, “privacy” depends on “consenting adults’” levels of agreement – you can’t force it (any more than you can in real life;-). A single leading underscore means you’re not supposed to access it “from the outside” — two leading underscores (w/o trailing underscores) carry the message even more forcefully… but, in the end, it … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)