Typescript for grails
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
783
On Slideshare
738
From Embeds
45
Number of Embeds
1

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 45

http://www.scoop.it 45

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. TypeScript&&Grails
  • 2. RailWayJSExpressTower.jsDerbyMeteorSocket IOGeddy.jsFlatiron.jsLocomotiveSocketStream
  • 3. TypeScript is✤ Language for application-scale JavaScript development✤ Typed superset of JavaScript that compiles to plain JavaScript✤ Any browser. Any host. Any OS. Open Source.✤ Strong Tools for Large Applications✤ Scalable✤ ES6 based
  • 4. TypeScript has
  • 5. ClearJSfunction Greeter(greeting) {this.greeting = greeting;}Greeter.prototype.greet = function () {return "Hello, " + this.greeting;};var greeter = new Greeter("world");
  • 6. Typesfunction Greeter(greeting: string) {this.greeting = greeting;}var greeter = new Greeter("world");
  • 7. Typesfunction Greeter(greeting: string) {this.greeting = greeting;}var greeter = new Greeter("world"); // okvar bad = new Greeter(5); // bad
  • 8. MoreTypes✤ Numbers✤ Boolean✤ Null✤ Undefined✤ Object✤ Void✤ Any
  • 9. Classesclass Greeter {greeting: string;constructor(message: string) {this.greeting = message;}greet() {return "Hello, " + this.greeting;}}var greeter = new Greeter("world");
  • 10. Inheritanceclass Animal {constructor(public name: string) { }move(meters: number) {alert(this.name + " moved " + meters + "m.");}}class Snake extends Animal {constructor(name: string) { super(name); }move() {alert("Slithering...");super.move(5);}}var sam = new Snake("Sammy the Python");sam.move();
  • 11. Modulesmodule Sayings {export class Greeter {greeting: string;constructor(message: string) {this.greeting = message;}greet() {return "Hello, " + this.greeting;}}}var greeter = new Sayings.Greeter("world");
  • 12. Interface
  • 13. InstallNode.jsonUbuntu##Install the dependencies:$ sudo apt-get install g++ curl libssl-dev apache2-utils$ sudo apt-get install git-core##Run the following commands:$ git clone git://github.com/ry/node.git$ cd node$ ./configure$ make && sudo make install##Check node:$ node -v
  • 14. InstallNode.jsonMacif (homebrew) {brew upgradebrew install nodenode -v} else {https://github.com/mxcl/homebrew/wiki/installation}
  • 15. InstallNode.jsonWindowshttp://nodejs.org/#download
  • 16. InstallNPM##Ubuntu:$ curl http://npmjs.org/install.sh | sh##Mac$ brew upgrade$ brew install npm##Windows:$ http://npmjs.org/doc/README.html#Installing-on-Windows-Experimental
  • 17. InstallTypeScript##Ubuntu && ##Mac && ##Win$ npm install -g typescript$ ts -v
  • 18. IDE
  • 19. Grailsintegration✤ Manual with console ($ ts path/to/your/ts/file)✤ IDE compilation✤ TypeScript Resource plugin
  • 20. Resourceplugin
  • 21. Questions???
  • 22. Thanks for yourattention!