1.

How do you declare a global variable in Angular 2?

Answer»

The SIMPLEST WAY is to put the variables in a file and export them. In order to USE global variables, you can use an import statement.

'use STRICT';

export const name='bestinterviewquestion.com';

After that, we can export this file where we want to use these global variables value.
import * as myGlobalsFile from './globalfile';



Discussion

No Comment Found