typescript2.2 Questions

6

Solved

Let's suppose I've a project, and its main source directory is: C:\product\src Based on this directory, every import path would be relative to it. I.e., suppose: // Current script: C:\product\s...

3

Solved

The Problem: I'm receiving a Typescript 2.2.1 compilation error when trying to append a compiled angular 1.5 template to an existing HTMLElement. Code: $document.find(scope.target)[0].append($co...
Griffen asked 21/6, 2017 at 22:22

2

Solved

I have a class that is decorated with a @MinDate constraint like this: export default class Order { purchaseDate: Date; @MinDate(this.purchaseDate) receiptDate: Date; } When attempting to val...
Bucher asked 2/5, 2017 at 16:11

1

Solved

I have the following TypeScript code: const allDescribeBlocks: Array<ITestSuite> = suman.allDescribeBlocks; async.eachSeries(allDescribeBlocks, function (block: ITestSuite, cb: Function) { ...
Sublunary asked 11/6, 2017 at 1:45

1

Solved

Some people in our team have both Visual Studio 2015 and Visual Studio 2017 installed. Others only have the latest Visual Studio 2017 (15.5). With the latter, we noticed that our TypeScript project...
Fatback asked 21/12, 2017 at 15:36

1

Solved

In the following code block heros is wrapped with curly braces: export class InMemoryDataService implements InMemoryDbService { createDb() { let heroes = [ {id: 11, name: 'Mr. Nice'}, {id: 12...
Howzell asked 8/6, 2017 at 22:45

1

Solved

I'm trying to run the following code with ts-node. import { writeFileSync, readFileSync } from 'fs'; However I get: src/main/ts/create.ts (1,45): Cannot find module 'fs'. (2307) What do I nee...
Piatt asked 6/5, 2017 at 21:12

1

I have this error from TS: It's pretty clear why the error occurs: function outer(){ if (true) { function inner(){ // nested function declaration } } } but my question is - why does TS...
Shin asked 19/4, 2017 at 1:23

0

I want to build a complete fullstack web app. My server side code is in typescript. I would like to configure my project such that it will be from the following structre: projectFolder/src/(serve...

1

Solved

I have function using an object as parameter like this: interface Options { foo?: string; bar?: number; }; function fooNction(opts: Options): void { } This works fine in some cases but not al...
Bentz asked 11/3, 2017 at 0:7

2

Solved

The code below was working fine with TypeScript 2.1.6: function create<T>(prototype: T, pojo: Object): T { // ... return Object.create(prototype, descriptors) as T; } After updating to T...
Kalevala asked 23/2, 2017 at 16:40
1

© 2022 - 2024 — McMap. All rights reserved.