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
var bodyParser = require('body-parser'); | |
var urlencodedParser = bodyParser.urlencoded({ extended: false }); | |
var jsonParser = bodyParser.json(); | |
module.exports = function(app) { | |
// This contains all of the endpoints that return views/html. | |
// The function takes an app object and adds the endpoints | |
// to the app. |
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
module.exports = function(app) { | |
// This contains all of the endpoints that return views/html. | |
// The function takes an app object and adds the endpoints | |
// to the app. | |
app.get('/', function(req, res) { | |
res.send('<html><head><link href=assets/style.css type=text/css rel=stylesheet /></head><body><h1>Donuts</h1></body></html>'); | |
}); | |
app.get('/form', function(req, res){ |
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
var express = require('express'); | |
var routes = require('./routes/index'); | |
var users = require('./routes/users'); | |
var app = express(); | |
var port = process.env.PORT || 3000; | |
// path matching / will be handled by routes/index.js. |
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
var express = require('express'); | |
// Router middleware; | |
// put GETs/POSTs/etc on Router | |
var router = express.Router(); | |
// GET /users/ | |
router.get('/', function(req, res, next) { | |
res.send('respond with a resource'); | |
}); |
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
var express = require('express'); | |
// Router middleware; | |
// put GETs/POSTs/etc on Router | |
var router = express.Router(); | |
// GET /index/ | |
router.get('/', function(req, res, next) { | |
res.send('Root'); | |
}); |
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
<script src="https://unpkg.com/@reactivex/rxjs@5.0.3/dist/global/Rx.js"></script> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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 { Component } from '@angular/core'; | |
@Component({ | |
selector: 'host', | |
templateUrl: './host.component.html', | |
styleUrls: [ './host.component.css' ] | |
}) | |
export class AppComponent { | |
} |
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
<h1>We'll change this soon</h1> |
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 { Component, Input } from '@angular/core'; | |
@Component({ | |
selector: 'hello', | |
template: `<h1>Hello {{name}}!</h1>`, | |
styles: [`h1 { font-family: Lato; }`] | |
}) | |
export class DynamicComponent { | |
@Input() name: string; | |
} |
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 { DynamicComponent } from './dynamic.component'; | |
@Component({ | |
selector: 'host', | |
templateUrl: './host.component.html', | |
styleUrls: [ './host.component.css' ], | |
entryComponents: [DynamicComponent] | |
}) |