【发布时间】:2016-03-27 14:58:09
【问题描述】:
index.js
这是我的入口点
import * as stylesheet from '../assets/styles/app.scss';
import jQuery from '../node_modules/jquery/dist/jquery';
import $ from '../node_modules/jquery/dist/jquery';
import {bootstrap} from './boot'
import {AppComponent} from './app.component'
bootstrap(AppComponent);
app.component.js
这行得通
(function (app) {
app.AppComponent = ng.core
.Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1>'
})
.Class({
constructor: function () {
}
});
})(window.app || (window.app = {}));
问题
我尝试使用来自How do I write angular2 without decorator syntax? 的答案但没有成功。
- 如何摆脱
IIFE并使用ES6语法?
【问题讨论】:
-
不清楚你在问什么。你想在有或没有
@Class装饰器支持的情况下使用 ES6 吗?如果是后者,则需要通过转译器设置启用装饰器支持。
标签: import ecmascript-6 angular iife