Recommended
PDF
PDF
大規模Node.jsを支える ロードバランスとオートスケールの独自実装
PDF
ECMAScript6による関数型プログラミング
PDF
PDF
GoCon 2015 Summer GoのASTをいじくって新しいツールを作る
PDF
Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略
PDF
[Tokyo NodeFest 2015] Hardware Hacking for Javascript Developers
PDF
PDF
PDF
PDF
PDF
asm.jsとWebAssemblyって実際なんなの?
PDF
React系(別言語含む)の サーバーサイドレンダリング について考えよう
PDF
JavaScriptCore.framework の普通な使い方 #cocoa_kansai
PDF
PDF
PDF
本当のClosure Compilerをお見せしますよ。
PDF
PPTX
PPTX
Retrofit2 &OkHttp
でAndroidのHTTP通信が快適だにゃん
PPTX
PDF
覚醒JavaScript -ES6で作るIsomophicアプリケーション-
PDF
PDF
ぼくのかんがえたさいきょうのうぇぶあぷりけーしょんふれーむわーく - YAPC Asia 2011
PDF
React Redux Redux-Saga + サーバサイドレンダリング
PPTX
PDF
PDF
PDF
PDF
TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...
More Related Content
PDF
PDF
大規模Node.jsを支える ロードバランスとオートスケールの独自実装
PDF
ECMAScript6による関数型プログラミング
PDF
PDF
GoCon 2015 Summer GoのASTをいじくって新しいツールを作る
PDF
Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略
PDF
[Tokyo NodeFest 2015] Hardware Hacking for Javascript Developers
PDF
What's hot
PDF
PDF
PDF
PDF
asm.jsとWebAssemblyって実際なんなの?
PDF
React系(別言語含む)の サーバーサイドレンダリング について考えよう
PDF
JavaScriptCore.framework の普通な使い方 #cocoa_kansai
PDF
PDF
PDF
本当のClosure Compilerをお見せしますよ。
PDF
PPTX
PPTX
Retrofit2 &OkHttp
でAndroidのHTTP通信が快適だにゃん
PPTX
PDF
覚醒JavaScript -ES6で作るIsomophicアプリケーション-
PDF
PDF
ぼくのかんがえたさいきょうのうぇぶあぷりけーしょんふれーむわーく - YAPC Asia 2011
PDF
React Redux Redux-Saga + サーバサイドレンダリング
PPTX
PDF
PDF
Similar to ng-japan 2015 TypeScript+AngularJS 1.3
PDF
PDF
TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...
PDF
PDF
PDF
TypeScript ファーストステップ (Rev.2) ~ Any browser. Any host. Any OS. Open Source. ~
PDF
TypeScript と Visual Studio Code
PDF
Visual Studio 2012 Web 開発 ~ One ASP.NET から TypeScript まで ~
PDF
TypeScript ファーストステップ ~ Any browser. Any host. Any OS. Open Source. ~
PDF
Buildinsider OFFLINE TypeScriptの基礎から実践・利用事例まで
PDF
DEV-011_TypeScript ~Any browser. Any host. Any OS. Open Source~
PDF
AngularJS+TypeScript - AngularJS 1周年記念勉強会
PDF
PDF
PDF
Angular ユーザーなら押さえておきたい! TypeScript と Visual Studio Code の基礎と活用
PPTX
JavaScript使いのためのTypeScript実践入門
PDF
はじめよう TypeScript - 入門から実践まで - 素の JavaScript とはさようなら!
PDF
pairsでのAngularJS x TypeScript x e2e @めぐすた#1
PDF
PDF
PDF
Visual Studio Codeで始めるTypeScript
More from Masahiro Wakame
PDF
GoCon2016 spring 自作Webフレームワーク uconを作った話
PDF
TypeScript 型定義ファイルのある開発 TypeScript勉強会 VSハッカソン倶楽部
PDF
PDF
Google Glassでできること XE12版 最新開発情報 Mirror API & GDK
PDF
20ヶ月を取り戻す Dart flight school
PDF
Google Glassでできること XE11版 最新開発情報 Mirror API & GDK
PDF
CEATEC Glassware(Google Glassアプリ)開発の指南と開発事例
PDF
ReVIEW & CI - ChefでCI環境構築
PDF
Firefox OS勉強会 2nd TypeScript+AngularJS
PDF
PDF
Datastoreへのアクセスを楽してMemcacheアクセスに置き換えるライブラリ作った
PDF
PDF
PDF
PDF
PDF
PDF
PDF
PDF
PDF
ng-japan 2015 TypeScript+AngularJS 1.3 1. 2. 3. 4. 6. 7. 8. 9. 10. AtScript
• AtScript == ES6+A!
• A == Annotations (Decorators)!
• AnnotationsはES6に含まれない!
• Super set of TypeScript!
• type annotations
http://goo.gl/5z43FE
http://goo.gl/Rs5rea
from AngularJS team!
11. 12. 13. 14. 15. 16. 17. 18. // Type definitions for Angular JS 1.3+
// Project: http://angularjs.org
// Definitions by: Diego Vilar <http://github.com/diegovilar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
declare var angular: angular.IAngularStatic;
// Support for painless dependency injection
interface Function {
$inject?: string[];
}
// Collapse angular into ng
import ng = angular;
// Support AMD require
declare module 'angular' {
export = angular;
}
///////////////////////////////////////////////////////////////////////////////
// ng module (angular.js)
///////////////////////////////////////////////////////////////////////////////
declare module angular {
// not directly implemented, but ensures that constructed class implements $get
interface IServiceProviderClass {
new (...args: any[]): IServiceProvider;
}
interface IServiceProviderFactory {
(...args: any[]): IServiceProvider;
}
// All service providers extend this interface
interface IServiceProvider {
$get: any;
}
interface IAngularBootstrapConfig {
既存JSに型を後付けする
http://goo.gl/xbjtzy
19. それを使う
///<reference path='../typings/angularjs/angular.d.ts' />
///<reference path='../typings/angularjs/angular-route.d.ts' />
module App {
"use strict";
angular.module(
"app",
[“ngRoute”, “app.hello”],
($routeProvider: ng.route.IRouteProvider, $locationProvider: ng.ILocationProvider)=> {
$routeProvider
.when("/sample", {
templateUrl: "/template/sample.html"
})
.otherwise({
templateUrl: "/template/main.html"
});
$locationProvider.html5Mode(true);
}
)
.run(($rootScope: ng.IRootScopeService, $routeParams: ng.route.IRouteParamsService)=> {
false;
})
;
angular.module(
"app.hello",
[],
()=> {
false;
}
)
.service("sampleService", Service.SampleService)
.controller("SampleTestController", Sample.TestController)
;
20. 21. 22. AtScript to TypeScript
• TypeScriptに必要な要素が入る!
• 作りたいのはAngularJS本体(のはず!
• TypeScriptのsuper setを作るのは難しい!
• TypeScriptの開発速度が早い!
楽をしよう!
23. 24. 25. Type Annotations
http://goo.gl/jKVeHw
var str1: string = "string";
var str2: number = "string"; // エラー!
var str3 = "string"; // 初期化子の型から型推論されstringを指定したのと等価
str3 = 1; // エラー!
!
var b: boolean = true;
var n: number = 1;
!
var a: any = true;
a = 1; // any は何でもOK!
26. 27. 28. Arrow Functions
http://goo.gl/XFyQRB
var hello = (word: string) => console.log("Hello, " + word);
hello("TypeScript");
!
// 返り値の型を明示する
var hello2 = (word: string): void => console.log("Hello, " + word);
// 参考:今まで通りの書き方 1
var hello3 = function (word: string) { console.log("Hello, " + word); };
// 参考:今まで通りの書き方 2
function hello4(word: string) { console.log("Hello, " + word); }
29. internal modules
http://goo.gl/V4ZDRa
module app {
export class Sample {
hello(word = "TypeScript") {
return `Hello, ${word}`;
}
}
}
var obj = new app.Sample();
console.log(obj.hello("AngularJS"));
var app;
(function (app) {
var Sample = (function () {
function Sample() {
}
Sample.prototype.hello = function (word) {
if (word === void 0) { word = "TypeScript"; }
return "Hello, " + word;
};
return Sample;
})();
app.Sample = Sample;
})(app ¦¦ (app = {}));
var obj = new app.Sample();
console.log(obj.hello("AngularJS"));
es6 module 普及したらbad practice
30. 31. 32. 33. 34. tools
• node.js!
• grunt!
• bower!
• wiredep!
• TypeScript!
• tslint!
• typedoc!
• dtsm (tsd)!
• LESS!
• unit test!
• mocha!
• power-assert!
• karma!
• protractor!
• その他細々…
35. tools
• node.js!
• grunt!
• bower!
• wiredep!
• TypeScript!
• tslint!
• typedoc!
• dtsm (tsd)!
• LESS!
• unit test!
• mocha!
• power-assert!
• karma!
• protractor!
• その他細々…ここだけ!
36. 37. 38. 39. 40. 41. 42. 43. tools
• node.js!
• grunt!
• bower!
• wiredep!
• TypeScript!
• tslint!
• typedoc!
• dtsm (tsd)!
• LESS!
• unit test!
• mocha!
• power-assert!
• karma!
• protractor!
• その他細々…
44. TypeScript
• npm install -g typescript!
• npm install grunt-ts —save-dev!
• npm install grunt-typescript —save-dev
どれか1つ!
45. 46. 47. 48. 49. 50. 51. 52. 53. 54. エディタ
• Visual Studio!
• WebStorm!
• IntelliJ IDEA!
• Eclipse!
• Atom!
• Sublime Text!
• Emacs!
• Vim!
• etc, etc…
Win
Mac
Mac WebStorm(IntelliJ IDEA)は
我が道を行ってる…
55. 56. 57. 58. 準備
• bower install angular angular-route!
• dtsm install angularjs/angular!
• dtsm install angularjs/angular-route
59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. Case D
• の何か!
• 2014年8月ぐらいから…?!
• わかめ抜き案件!
• TypeScript 1.3.0!
• AngularJS 1.2.26 頑張ってるぽい
79. 80. 81. 82. 83. 84. 案:Type base DI
class FooController {
constructor($window: ng.IWindowService) {
}
}
var FooController = (function () {
function FooController($window) {
this.$window = $window;
}
return FooController;
})();
FooController.$inject = [ $window ];
85. 86. 案:Type Check in HTML
• AngularJSコードコンパイル後の型情報!
• routeProviderでの表記!
• HTMLでの記述!
• 静的に突き合わせてチェック可能??
87.