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 moritaA{ | |
export interface Imorita {//(1) | |
get: Function; | |
num1: number; | |
num2: number; | |
} | |
export class Aclass implements Imorita{ | |
public num1:number = 1 | |
public num2:number = 4 | |
constructor(){ |
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 A{ | |
interface ImoritaA{ | |
name:string; | |
} | |
class Aclass implements ImoritaA{ | |
constructor(public name){ | |
this.name = "fafa" | |
} | |
public func1= ()=>{//constructor外、無名関数を代入 | |
} |
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
//ex1 babel | |
function today() { return { d: 6, m: 2, y: 2013 }; } | |
var { m: month, y: year } = today(); // month = 2, year = 2013 | |
//ex1 after | |
"use strict"; | |
function today() { | |
return { d: 6, m: 2, y: 2013 }; | |
} | |
var _today = today();//関数名が「_変数」になっている |
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
//ex1 //値返す書き方 | |
var myApp = angular.module('MyApp',[]); | |
myApp.factory('myUrlFactory',function myUrlFunc(){ | |
return 'https://github.com/kenjimorita/'; | |
}) | |
//ex2 //関数を返す書き方 | |
var myApp = angular.module('MyApp',[]); | |
myApp.factory('myFunc',function($window){ | |
return{ |
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
//mapを作成 | |
var map1 = Immutable.Map({ | |
a: 1, | |
b:2, | |
c: 3 | |
});] | |
//新しい配列やMapを返すところ。不変なオブジェクトを返す |
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 arr = [1, 2, 3, 4, 6] | |
const arr2 = [1, 2, 3, 4, 5] | |
const arr3 = [...arr, ...arr2] | |
const a = [] | |
for (let [i, e] of arr3.entries()) { | |
if(!arr.includes(e)) a.push(e) | |
if(!arr2.includes(e)) a.push(e) | |
} | |
console.log(a) |
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
///webpack.config.js変更前///// | |
module: { | |
loaders: [ | |
{ test: /\.jsx?$/, exclude: /node_modules/, | |
loaders: ['react-hot'] | |
} | |
] | |
}, | |
///変更後//// |
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
function renderToElements(elements) { | |
Array.prototype.slice.call(elements).forEach(function(e, i){ | |
React.render(<FavoriteFortune id={e.dataset.id} isFavorite={true} />, e); | |
}) | |
} | |
renderToElements(document.getElementsByClassName('favoriteFortune')); |
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
{ | |
"comments": [ | |
{ | |
"body": "some comment", | |
"id": 1, | |
"postId": 1 | |
} | |
], | |
"posts": [ | |
{ |
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
<properties> | |
<property name="eclipselink.jdbc.user" value="APP"/> | |
<property name="eclipselink.jdbc.password" value="APP"/> | |
</properties> | |
OlderNewer