Skip to content

Instantly share code, notes, and snippets.

@NgModule({
imports: [
BrowserModule,
FormsModule,
GridModule.withComponents([
BlueDynamicComponent,
GreenDynamicComponent,
RedDynamicComponent
])
],
@NgModule({
imports: [
BrowserModule,
FormsModule
],
declarations: [
Grid,
Cell
],
exports: [
@Component({
selector: 'grid-cell',
template: ''
})
export class Cell implements OnInit {
@Input() componentType: any;
constructor(private viewContainerRef: ViewContainerRef,
private cfr: ComponentFactoryResolver) {
}
ngOnInit() {
@Component({
selector: 'grid-component',
template: `
<div class="row" *ngFor="let cellComponentType of cellComponentTypes">
<<div class="col-lg-12">
<grid-cell [componentType]="cellComponentType"></grid-cell>
</div>
</div>
`
})
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './dist/'),
filename: 'bundle.js',
publicPath: 'dist/'
},
module: {
import multiply from './multiply';
import sum from './sum';
// import our image utility
import addImageToPage from './image_util';
// import the images we want to use
import multiplyImg from '../images/multiply.png';
import sumImg from '../images/sum.png';
const addImageToPage = (imageSrc) => {
const image = document.createElement('img');
image.src = imageSrc;
image.style.height = '100px';
image.style.width = '100px';
document.body.appendChild(image);
};
export default addImageToPage;
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './dist/'),
filename: 'bundle.js'
},
module: {
loaders: [
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './dist/'),
filename: 'bundle.js'
},
module: {
loaders: [
{
import multiply from './multiply';
import sum from './sum';
// import the CSS we want to use here
import './math_output.css';
const totalMultiply = multiply(5, 3);
const totalSum = sum(5, 3);
// create the body