node.js - Angular2 with TypeScript: Declaration expected compiler error after @component -


im getting kind of error despite of fact imported component angular2/core should source files not downloaded through npm install or node needs upgrade

here file

import {bootstrap} 'angular2/platform/browser'; import {component, view} 'angular2/core';  @component({  }) 

define class right after component.

import {bootstrap} 'angular2/platform/browser'; import {component, view} 'angular2/core';  @component({  }) class myclass {  } 

@component decorator contains metadata class. in other words defines stuff class in more elegant way.

the @component function takes configuration object , turns metadata attaches component class definition. angular discovers metadata @ runtime , knows how "the right thing".

read more here


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -