Skip to content

Instantly share code, notes, and snippets.

View ysyun's full-sized avatar

YoungSik Yun ysyun

View GitHub Profile
@ysyun
ysyun / karma.conf.js
Created April 14, 2013 08:27
Karma Defualt Config File
// Karma configuration
// base path, that will be used to resolve files and exclude
basePath = '';
// list of files / patterns to load in the browser
files = [
JASMINE,
JASMINE_ADAPTER,
'app/components/angular/angular.js',
@ysyun
ysyun / main.js
Created April 14, 2013 08:48
angular module code sample
'use strict';
var app = angular.module('eggheadioApp');
app.controller('MainCtrl', function ($scope) {
$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];
@ysyun
ysyun / mainSpec.js
Created April 14, 2013 08:49
angular module BDD test sample
describe('filter', function() {
beforeEach(module('eggheadioApp'));
describe('reverse', function() {
iit('should reverse a string', inject(function(reverseFilter){
expect(reverseFilter('ABCD')).toEqual('DCBA');
}))
})
})
@ysyun
ysyun / superhero.js
Created April 14, 2013 10:18
AngularJS Directive Sample. Directive to Directive Communication
/*<div ng-app="superApp">
<superhero flight speed strength>Superman</superhero>
<superhero speed>Flash</superhero>
<superhero strength>Hulk</superhero>
</div>*/
var app = angular.module("superApp", []);
@ysyun
ysyun / twitter.js
Created April 14, 2013 10:20
AngularJS Directive Sample Directive to Controller Communication
/*<div ng-app="twitterApp">
<div ng-controller="AppCtrl">
<div enter="loadMoreTweets()">Roll over to load more twitt</div>
</div>
</div> */
var app = angular.module("twitterApp", [])
app.controller("AppCtrl", function($scope){
@ysyun
ysyun / drink.js
Created April 14, 2013 12:30
AngularJS Local Scope Property @
/*
local scope property
<div ng-app="drinkApp">
<div ng-controller="AppCtrl">
<div drink flavor="strawberry"></div>
</div>
</div>*/
var app = angular.module("drinkApp", []);
@ysyun
ysyun / drink.js
Created April 14, 2013 12:30
AngularJS Local Scope Property @
/*
local scope property
<div ng-app="drinkApp">
<div ng-controller="AppCtrl">
<div drink flavor="strawberry"></div>
</div>
</div>*/
var app = angular.module("drinkApp", []);
@ysyun
ysyun / drink.js
Created April 14, 2013 12:31
AngularJS Local Scope Property Sample
/*
local scope property
<div ng-app="drinkApp">
<div ng-controller="AppCtrl">
<div drink flavor="strawberry"></div>
</div>
</div>*/
var app = angular.module("drinkApp", []);
@ysyun
ysyun / drink.js
Created April 14, 2013 12:41
AngularJS bi-directional bindin between local property and parent scope property
/*
<div ng-app="drinkApp">
<div ng-controller="AppCtrl">
Ctrl
<input type="text" ng-model="ctrlFlavor">
Dir
<div drink flavor="ctrlFlavor"></div>
</div>
</div>
@ysyun
ysyun / phone.js
Created April 14, 2013 12:57
AngularJS & scope send local property to parent scope
/*
& scope
<div ng-app="phoneApp">
<div ng-controller="AppCtrl">
<div phone dial="callHome(message)"></div>
<div phone dial="callHome(message)"></div>
</div>
</div>
*/