Unable to refer external module in TypeScript -
i want use external module in typescript code, failing. specifically, want use methods referring external.d.ts file in typescript script.
my code is:
module test { //this not working. want know syntax refer express here. private express: typeof express = require("express"); export testserver { constructor(private app:express.application) { //can not find express symbol } }
//this not working. want know syntax refer express here. private express: typeof express = require("express");
use import
:
import express = require("express"); export testserver { constructor(private app:express.application) { } }
and don't mix internal , external modules. more in youtube video typescript modules demystified: internal, amd requirejs, commonjs node.js.
Comments
Post a Comment