This file contains hidden or 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
| <div class="my-center uk-card uk-card-default uk-card-body uk-animation-slide-right"> | |
| <div class="uk-width-1-2@s uk-width-1-3@m"> | |
| <!--Title and logout Button--> | |
| <div class="uk-grid-collapse uk-child-width-expand@s" uk-grid> | |
| <div class="uk-width-1-2"> | |
| <h3 class="uk-card-title">Chat</h3> | |
| </div> | |
| <div class="uk-width-1-2"> | |
| <button class="uk-button uk-width-1-1 uk-button-danger" (click)="logout()">Logout</button> |
This file contains hidden or 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
| <div class="my-center uk-background-secondary uk-light uk-card uk-card-default uk-card-body uk-animation-slide-right"> | |
| <div class="uk-card uk-card-body uk-width-1-2@s uk-width-1-3@m uk-width-1-4@l"> | |
| <h3 class="uk-card-title">Login</h3> | |
| <hr> | |
| <button class="uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom" (click)="login('google')">Google</button> | |
| <button class="uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom" (click)="login('twitter')">Twitter</button> | |
| </div> | |
| </div> |
This file contains hidden or 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
| .my-center { | |
| width: 100vw; | |
| min-height: 100vh; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| } | |
| .my-messages { | |
| height: 60vh; |
This file contains hidden or 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
| 'use strict' | |
| const _ = require('lodash'); | |
| module.exports = function (Task) { | |
| return { | |
| // ... | |
| all: function (req, res) { | |
| const promise = Task.find({}).sort('-level createdAt').exec(); |
This file contains hidden or 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
| 'use strict' | |
| const _ = require('lodash'); | |
| module.exports = function (Task) { | |
| return { | |
| // ... | |
| show: function (req, res) { | |
| res.json(req.task); |
This file contains hidden or 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
| 'use strict' | |
| const _ = require('lodash'); | |
| module.exports = function (Task) { | |
| return { | |
| // ... | |
| destroy: function (req, res) { | |
| const task = req.task; |
This file contains hidden or 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
| 'use strict' | |
| const _ = require('lodash'); | |
| module.exports = function (Task) { | |
| return { | |
| // ... | |
| update: function (req, res) { | |
| let task = req.task; |
This file contains hidden or 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
| 'use strict' | |
| const _ = require('lodash'); | |
| module.exports = function (Task) { | |
| return { | |
| // ... | |
| create: function (req, res) { | |
| const task = new Task(req.body); |
This file contains hidden or 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
| 'use strict' | |
| const _ = require('lodash'); | |
| module.exports = function (Task) { | |
| return { | |
| task: function (req, res, next) { | |
| Task.findById(req.params.taskId, function (err, task) { | |
| if (err) return next(err); | |
| if (!task) return next(new Error('Faileed to load task ' + req.params.taskId)); |
This file contains hidden or 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
| 'use strict' | |
| const _ = require('lodash'); | |
| module.exports = function (Task) { | |
| return { | |
| task: fn() { | |
| // ... | |
| }, | |
| create: fn() { |
NewerOlder