A
A
Alexey Romanov2016-02-28 02:22:05
JavaScript
Alexey Romanov, 2016-02-28 02:22:05

Why does ES 6 scold ":" in constructor?

Dear comrades, help me deal with the problem, I've been sitting dumb for an hour and slowly starting to get psycho =).
Example :

import {Http} from 'angular2/http'

export class Test {
    constructor(http: Http) {
        this.http = http;
    }
}

Swears at ":" in the constructor and that's it.
"Module build failed: SyntaxError: /filepath/file.js: Unexpected token (14:10)"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2016-02-28
@badkidddd

this is TypeScript syntax and in native js it doesn't work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question