View file0.txt
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(){ |
View file0.txt
module A{ | |
interface ImoritaA{ | |
name:string; | |
} | |
class Aclass implements ImoritaA{ | |
constructor(public name){ | |
this.name = "fafa" | |
} | |
public func1= ()=>{//constructor外、無名関数を代入 | |
} |
View ES6
//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();//関数名が「_変数」になっている |
View file0.js
//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{ |
View immutableJS_Map.js
//mapを作成 | |
var map1 = Immutable.Map({ | |
a: 1, | |
b:2, | |
c: 3 | |
});] | |
//新しい配列やMapを返すところ。不変なオブジェクトを返す |
View 【JavaScript】2以上の配列の差分を新たな配列として返す方法(array-diff) How to return the difference between two sequences as a new array.js
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) |
View webpack.config.js
///webpack.config.js変更前///// | |
module: { | |
loaders: [ | |
{ test: /\.jsx?$/, exclude: /node_modules/, | |
loaders: ['react-hot'] | |
} | |
] | |
}, | |
///変更後//// |
View getElementsByClass[Tag]NameでReact.renderする.js
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')); |
View json-server-init.json
{ | |
"comments": [ | |
{ | |
"body": "some comment", | |
"id": 1, | |
"postId": 1 | |
} | |
], | |
"posts": [ | |
{ |
View 接続認証エラーが発生しました。理由: ユーザーIDまたはパスワードが無効です.xml
<properties> | |
<property name="eclipselink.jdbc.user" value="APP"/> | |
<property name="eclipselink.jdbc.password" value="APP"/> | |
</properties> | |
OlderNewer