AngularJS to TypeScript converting

Topics: Code Checkins, General, Language Specification
Mar 24, 2014 at 5:11 PM
Hello

How can I rewrite this AngularJS code to TypeScript for passing data from a view to controller? AngularJS code
Mar 24, 2014 at 5:46 PM
Try starting with the type definitions here: https://github.com/borisyankov/DefinitelyTyped
Mar 24, 2014 at 6:11 PM
jamesnw wrote:
Try starting with the type definitions here: https://github.com/borisyankov/DefinitelyTyped
It's added to the solution. But how does it help in my specific task? How should I apply it to convert the code?
Mar 24, 2014 at 8:11 PM
Exactly as it is shown.
(function () {
    angular.module('serverIncludedData',[])
      .value("myData",
         {
            where: 'from .Net',
            isthis: 'comming from'
         }
    )
})();
OR you can move the code into a .ts file, remove it from your HTML page, create a <script> reference to the .js file created from the .ts file.
Mar 25, 2014 at 8:53 AM
Edited Mar 25, 2014 at 8:54 AM
But the qestion is how can I rewrite .ts file correctly to retrive myData object, like this:

module sample {
export class sampleController {
    constructor($scope) {
Mar 25, 2014 at 9:04 AM