An Angular 2 Webpack Starter kit featuring Angular 2, Router, TypeScript, and Webpack by AngularClass
[(ngModel)]
directive instead of [value]="data.value" (input)="data.value = $event.target.value"
I get such error after html minification
customAttrSurround: [[/#/, /(?:)/], [/\*/, /(?:)/], [/\[?\(?/, /(?:)/]],
customAttrAssign: [/\)?\]?=/]
ORIGINAL EXCEPTION: Primary outlet is already registered.
. My app.ts :/*
* Angular 2 decorators and services
*/
import {Component} from 'angular2/core';
import {RouteConfig} from 'angular2/router';
// import {FORM_PROVIDERS} from 'angular2/common';
// import {RouterActive} from './directives/router-active';
// import {HeaderComponent} from './header/header';
import {FooterComponent} from './footer/footer';
import {Home} from './home/home';
// import {Admin} from './admin/admin';
/*
* App Component
* Top Level Component
*/
@Component({
selector: 'app',
// providers: [...FORM_PROVIDERS],
directives: [FooterComponent],
pipes: [],
styles: [`
main {
font-size: 1rem;
line-height: 1.5;
color: #666;
background-color: #ededed;
}
:global(body) {
color: #666;
background-color: #ededed;
}
`],
template: `
<main>
<header>
<nav>
<h1>Hello</h1>
</nav>
</header>
<router-outlet></router-outlet>
<footer-component></footer-component>
</main>
`
})
@RouteConfig([
{ path: '/', component: Home, name: 'Index', useAsDefault: true },
{ path: '/home', component: Home, name: 'Home' },
])
export class App {
constructor() {
}
}
No Directive annotation found on Alert
error when write like so directives: [Alert]
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'.