future of scripting
TRANSCRIPT
![Page 1: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/1.jpg)
Umbraco, Angular and Typescript
Making typescript a part of the way you work
![Page 2: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/2.jpg)
HELLO
![Page 3: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/3.jpg)
PER
![Page 4: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/4.jpg)
Agenda
![Page 5: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/5.jpg)
Umbraco + angular Tooling Benefits
Perspective
![Page 6: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/6.jpg)
MEMEMEMEMEMEMEMEMEMEMEME
![Page 7: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/7.jpg)
Umbraco
![Page 8: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/8.jpg)
package.manifest
{ /views/license.html /scripts/controller.js /styles/style.css}
Server
Browser
{ /views/license. /scripts/contro /styles/style. }
![Page 9: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/9.jpg)
Hello world demo
![Page 10: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/10.jpg)
tooling
![Page 11: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/11.jpg)
automation testing
optimization
![Page 12: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/12.jpg)
JS Tooling Ecosystem• Code Editor (Atom,Sublime,Brackets Visual Studio)
• Build system (MsBuild, Grunt, Gulp, Jake, Broccoli)
• Dependencies (Nuget, Bower, npm, tsd)
• Compiler (tsc)
• Scaffolding (yeoman)
• Unit testing (karma, TsUnit, jasmine)
![Page 13: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/13.jpg)
> npm install typescript -g> tsc file.ts
![Page 14: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/14.jpg)
![Page 15: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/15.jpg)
My Yeoman workflow
![Page 16: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/16.jpg)
GruntAtom Karma
Grunt-ts Grunt-tsd
Atom-Typescript
![Page 17: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/17.jpg)
My Yeoman with Typescript workflow
![Page 18: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/18.jpg)
JSvsTS
![Page 19: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/19.jpg)
syntax
![Page 20: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/20.jpg)
angular.module(‘umbraco').controller('DriversLicenseEditorController', ['$scope',
function($scope) {
//your code
}
]);
![Page 21: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/21.jpg)
module License.Controllers {
export class LcsController {static $inject = [‘$scope'];
constructor(private $scope) {//your code
}
angular.module(‘umbraco').controller(‘LicenseController',LcsController);
}
![Page 22: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/22.jpg)
angular.module(‘umbraco').directive('someDirective', [‘$timeout',
function($timeout) {
return { link: link, templateUrl: ‘view.html', restrict: 'EA' };
function link(scope, element, attrs) { /* your code */ }}]);
![Page 23: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/23.jpg)
class MyDirective { public link: (scope: ng.IScope,
element: ng.IAugmentedJQuery, attrs: ng.IAttributes) => void;
public templateUrl = ‘view.html';
constructor(/*list of dependencies*/) { this.link = (scope: ng.IScope,
element: ng.IAugmentedJQuery, attrs: ng.IAttributes) =>
{ /*handle all your linking requirements here*/ };
} public static Factory() { var directive = (/*list of dependencies*/) => { return new MyDirective(/*list of dependencies*/); };
directive['$inject'] = ['/*list of dependencies*/']; return directive; }}angular.module(“umbraco”, MyDirective.Factory() );
![Page 24: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/24.jpg)
module Project.Directives { export interface IMyScope: ng.IScope { name: string; }
export function MyDirective(): ng.IDirective { return { template: '<div>{{name}}</div>', scope : {}, link : (scope: IMyScope) => { scope.name = 'Aaron'; } }; }
angular.module(“umbraco”, MyDirective );}
![Page 25: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/25.jpg)
![Page 26: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/26.jpg)
structure
![Page 27: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/27.jpg)
![Page 28: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/28.jpg)
scope, model interfaces any => concrete
![Page 29: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/29.jpg)
![Page 30: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/30.jpg)
definitions
![Page 31: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/31.jpg)
![Page 32: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/32.jpg)
> npm install tsd -g> tsd install jquery> tsd install angularjs
![Page 33: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/33.jpg)
Angular.d.ts
![Page 34: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/34.jpg)
discovery
![Page 35: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/35.jpg)
service discovery
![Page 36: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/36.jpg)
tooling
![Page 37: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/37.jpg)
You all get your own workflow!
![Page 38: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/38.jpg)
• Code Editor (Atom,Sublime,Brackets Visual Studio)
• Build system (MsBuild, Grunt, Gulp, Jake, Broccoli)
• Dependencies (Nuget, Bower, npm, tsd)
• Compiler (tsc)
• Scaffolding (yeoman)
• Unit testing (karma, TsUnit, jasmine)
![Page 39: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/39.jpg)
perspective
![Page 40: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/40.jpg)
Future of JS now Angular 2
In developement Not M$ only
![Page 42: Future of scripting](https://reader035.vdocuments.net/reader035/viewer/2022062514/55a888751a28abd1288b4650/html5/thumbnails/42.jpg)