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
{ | |
"$schema": "http:\/\/json-schema.org\/schema#", | |
"definitions": { | |
"pathType": { | |
"type": "string", | |
"pattern": "^([a-z0-9]([a-z0-9-]*[a-z0-9]+)*)([.][a-z0-9]([a-z0-9-]*[a-z0-9]+)*)*$", | |
"minLength": 1 | |
} | |
}, | |
"type": "object", |
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 models = require('../models'); | |
models.user.findOne({ where: {id: id} }) | |
.then(user => { | |
// Do something with User instance | |
}); | |
models.user.create(data) | |
.then((newUser) => { | |
// Do something with User instance |
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 models = require('../models'); | |
models.sequelize.sync().then(function() { | |
server.listen(port); | |
server.on('error', onError); | |
server.on('listening', onListening); | |
}); |
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 fs = require('fs'); | |
const path = require('path'); | |
const Sequelize = require('sequelize'); | |
const config = require('../config/db'); | |
let db = {}; | |
let sequelize = new Sequelize(config.database, config.username, config.password, config.options); | |
fs | |
.readdirSync(__dirname) |
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(sequelize, Sequelize) { | |
const User = sequelize.define('user', { | |
id: { | |
autoIncrement: true, | |
primaryKey: true, | |
type: Sequelize.INTEGER | |
}, | |
firstname: { | |
type: Sequelize.STRING, | |
notEmpty: true |
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 Sequelize = require('sequelize'); | |
const sequelize = new Sequelize('database', 'username', 'password', { | |
host: 'SQL.server.address.database.net', | |
dialect: 'mssql', | |
dialectOptions: { | |
encrypt: true; | |
} | |
}); | |
sequelize |
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
@ViewChild(HelloComponent) hello: HelloComponent; | |
@ViewChildren(HelloComponent) hellos: QueryList<HelloComponent>; | |
ngAfterViewInit() { | |
console.log(this.hello); | |
console.log(this.hellos); | |
} |
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
@ViewChild(HelloComponent) hello: HelloComponent; | |
@ViewChild('template') template: TemplateRef<any>; | |
@ViewChild('element') element: ElementRef; | |
@ViewChild('container', { read: ViewContainerRef }) container: ViewContainerRef; | |
ngAfterViewInit() { | |
console.log(this.hello); | |
console.log(this.template); | |
console.log(this.element); | |
console.log(this.container); |
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
<hello name="Jelly Donut"></hello> | |
<hello name="Old Fashioned Glazed"></hello> | |
<ng-container #container> | |
This is a container | |
</ng-container> | |
<ng-template #template> | |
This is a template |
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
<some-component> | |
<h3>I am the projected content!</h3> | |
</some-component> |
NewerOlder