Get array data from external ts

I have a tab page page2 and in the folder page2 the ts file is page2.ts.
This ts file is very big as this hase array data which contain 7000 sentences.
Problem is that When I m working on the page2.ts, this is very slow.
So, I want that external ts file will be included in page2.ts.

Example- data.ts file will contain amy array data
and page2.ts will get the array data from that data.ts file. is it possible ?

I eagerly await the moment when you decide to hire somebody to build this application that has the faintest clue about what they are doing.


Could not agree more.

instead of a ts file --> create a .json-file and make a $http-request to get the data.

Or create a DataService (injectable in angular 2) which holds a key named data --> so you can inject that service to your components.

1 Like