An Angular 2 Webpack Starter kit featuring Angular 2, Router, TypeScript, and Webpack by AngularClass
Here's a little example:
app.component.ts
import {Alert} from 'ng2-bootstrap/ng2-bootstrap';
@Component({
selector: 'app',
providers: [],
directives: [Alert],
pipes: [],
styles: [require('./app.component.scss')],
template: require('./app.component.html')
})
export class App {
Alert component
@Component({
selector: 'alert',
directives: [NgIf, NgClass],
template: ALERT_TEMPLATE
})
export class Alert implements OnInit {
.....
Browser logs:
browser_adapter.js:76 EXCEPTION: No Directive annotation found on Alert
Env: angular2-webpack-starter
& ng2-bootstrap
.
I have in vendor.js
import 'lodash';
in my service:
import * as _ from 'lodash';
vendor.js
instead of main.js
import ‘lodash';
does not complain, and _.merge
is there
import ‘lodash/merge';
does not complain, but _.merge
is not there
import merge from ‘lodash/merge';
complains that Cannot find module 'lodash/merge’
, same with import { merge }
or import * as merge
import * as merge from 'lodash/merge'
would have worked... except you don't want a bare object merge
you want _.merge
lodash/merge
the actual location in node_modules
? Cannot find module 'lodash/merge'.
WARNING in ./~/primeng/components/datagrid/datagrid.js
Cannot find source file 'datagrid.ts': Error: Cannot resolve 'file' or 'directory' ./datagrid.ts in /Users/nsmith/projects/cohortable/node_modules/primeng/components/datagrid