A
A
Andrew2019-08-08 18:14:37
visual studio
Andrew, 2019-08-08 18:14:37

What is the correct way to start using typescript modules in visual studio?

There is VS 2017, she knows how to use TS out of the box.
There is a simple project in which there was one ts-file. Everything was ok.
Now I'm trying to split the file into parts, and it doesn't work.

// Position.ts
export enum Position {
    Top,
    Left,
    Bottom,
    Right,
}

// application.ts. Код импорта сгенерирован решарпером, поэтому выглядит кривовато.
import Position1 = require("./Position");
import Position = Position1.Position;

I also tried this way
import { Position } from './Position';
. On the page, I connect only the script itself
. And as a result, an error . The error
ReferenceError: System is not defined
text may vary depending on which system of modules is selected.
How to get started using modules?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question