Skip to content

Instantly share code, notes, and snippets.

View chief10's full-sized avatar
🎯
Focusing

chief10

🎯
Focusing
  • Los Angeles, CA
View GitHub Profile
angular.module('myApp')
.component('simpleItem', {
template: '<h1>Meeting: {{ $ctrl.getMeetingInfo() }}</h1>',
controller: function() {
this.getMeetingInfo = function() {
return ("Person: " + this.who + ' ' + "At: " + this.where);
}
},
bindings: { who: '<', where: '<'}
})
'use strict';
angular.module('myApp')
.component('aComponent', {
template: '<div> Hello, {{ $ctrl.localName }}!</div>',
controller: function() {
this.localName = "World";
}
});
'use strict';
angular.module('myApp')
.controller('myController', function() {
var vm = this;
//Info that is needed in the view to properly
//display user information.
vm.viewInfo = {
personName: "",
'use strict';
angular.module('myApp')
.controller('myController', function() {
var vm = this;
//Info that is needed in the view to properly
//display user information.
vm.viewInfo = {
personName: "",
<div ng-app="myModule"
ng-controller="myNgCtrl as vm">
<div class="my-image-container">
<img ng-src="{{vm.image}}"
class="my-image"
ng-animate-swap="vm.image"/>
</div>
</div>
.my-image {
transition: 0.75s ease-in-out transform;
&.ng-enter {
transform: translateX(-100%);
}
&.ng-enter-active,
&.ng-leave {
transform: translateX(0);
angular.module('myModule', ['ngAnimate'])
.controller('myNgCtrl', function($interval, $scope) {
var vm = this;
var cycleFn = $interval(grabNextImage, 3000);
var myImages = [
'http://placebeyonce.com/450-300',
'http://placehold.it/450x300',
'http://placekitten.com/g/450/300'
];
@chief10
chief10 / gist:d85509bbd481a5c32ce7
Created February 25, 2016 18:19
express-packagejson.json
{
"name": "express-app",
"version": "1.0.0",
"description": "An Example Express App for a blog post",
"main": "index.js",
"dependencies": {
"body-parser": "^1.15.0",
"express": "^4.13.4",
"mongoose": "^4.4.5"
}
@chief10
chief10 / index.js
Last active February 25, 2016 19:19
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
var router = express.Router();
var port = process.env.PORT || 9000;
//Middleware that only parses `urlendoded` bodies.
//`extended` allows for an option as to which library
//one wants to use when parsing URL-encoded data.
app.use(bodyParser.urlencoded({
//...
router.get('/hello', function(req, res) {
res.json({
message: 'Hello, friend!'
});
});
router.get('/bye', function(req, res) {
res.json({
message: 'See yea later!'