question

tunemy15-9669 avatar image
0 Votes"
tunemy15-9669 asked AnnaXiu-MSFT edited

It's possible define a new Type using values from environment.ts?

So, I have this into environment.ts:

 export const common = {
     TYPES_COOL: ['cool0','cool1','cool2'] 
 }

And wanna use this values to define a new type into myCoolModel.model.ts:

 import { common } from 'environment.ts';
 export type MyType =   common.TYPES_COOL[0] | common.TYPES_COOL[1] | common.TYPES_COOL[2];

But Visual Code launch error -> Cannot find namespace 'common'.

It's possible define new types using values from environment.ts ?


not-supported
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AnnaXiu-MSFT avatar image
0 Votes"
AnnaXiu-MSFT answered

Hi @tunemy15-9669,

It seems that you are using Visual Studio Code, which is different from Visual Studio. The tag “vs-setup” is related to Visual Studio, for more questions about Visual Studio Code, we suggest you post it to the GitHub-vscode forum where you would get support for this product.

Thanks for your understanding.

Sincerely,
Anna


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.