This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NgModule({ | |
imports: [ | |
BrowserModule, | |
FormsModule, | |
GridModule.withComponents([ | |
BlueDynamicComponent, | |
GreenDynamicComponent, | |
RedDynamicComponent | |
]) | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NgModule({ | |
imports: [ | |
BrowserModule, | |
FormsModule | |
], | |
declarations: [ | |
Grid, | |
Cell | |
], | |
exports: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'grid-cell', | |
template: '' | |
}) | |
export class Cell implements OnInit { | |
@Input() componentType: any; | |
constructor(private viewContainerRef: ViewContainerRef, | |
private cfr: ComponentFactoryResolver) { | |
} | |
ngOnInit() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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> | |
` | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
module.exports = { | |
entry: './src/index.js', | |
output: { | |
path: path.resolve(__dirname, './dist/'), | |
filename: 'bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |