I have some code:  baseTypes.ts  export namespace Living.Things {   export class Animal {     move() { /* ... */ }   }   export class Plant {     photosynthesize() { /* ... */ }   } }   dog.ts  import b = require('./baseTypes');  export nam...
I'm looking at implementation of private members in TypeScript, and I find it a little confusing. Intellisense doesn't allow to access private member, but in pure JavaScript, it's all there. This makes me think that TS doesn't imple...
Is there a way to do method overloading in TypeScript language?  I want to achieve something like this:  class TestClass {     someMethod(stringParameter: string): void {         alert("Variant #1: stringParameter = " + stringParameter);...
I load a JSON configuration file at runtime, and use an interface to define its expected structure:  interface EngineConfig {     pathplanner?: PathPlannerConfig;     debug?: DebugConfig;     ... }  interface PathPlannerConfig {     nbMaxIter?: num...
Looks like in TypeScript it's absolutely fine (from the compiler perspective) to have such code:  class Vehicle {     public run(): void { console.log('Vehicle.run'); } }  class Task {     public run(): void { console.log('Task.run&...
I'm trying to load dynamically a component in the final release 2.0.0.  Using RC5 I was loading using the following code:  Create a directive to load the controls:  import {   CheckboxComponent, CheckboxListComponent,DatePickerComponent } from...
In TypeScript, when creating .d.ts source declaration files, which is preferable and why?  declare class Example {     public Method(): void;  }   or  interface Example {     Method(): void; }   The differences that I can tell are that interfaces c...
I have an array of objects that is an input. Lets call it content.  When trying to deep copy it, it still has a reference to the previous array.  I need to duplicate that input array, and change one property of the duplicated part.   So long I'...
I know that 'this' in JavaScript has a different meaning than in in TypeScript, as per this article 'this' in TypeScript. I have the following code in JavaScript used to create a thicker stroke on the selected node, and give all oth...
I'm using arrow functions and I'm debugging with Chrome and Firefox Dev Tool. I am getting, this as undefined, even though the code still works.   My assumption is, that it has something to do with source-maps.  Here are the tools I use in...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.