1

I'm trying to migrate from Angular 1.3 to Angular 4 and my first step according to the guide on https://angular.io/guide/upgrade#migrating-to-typescript is to migrate to typescript.

I changed all of the js files in one component to ts files. However this resulted me in the error

Error: Script error for "app/dashboard/widgets/assignments", needed by: app/dashboard/widgets

The component I changed to ts is app/assignments/* and app/dashboard/widgets/assignments.js calls for that here on the first line:

define(['lib/require','lib/angular', 'lib/moment', 'lib/lodash', 
        'app/oModal', 'app/assignments/ows', 'app/lazyLoader', 
        'app/dashboard/controllers', 'ng!app/utils'], 
 function(require, angular, moment, _) {
'use strict';

As stated by Angular I should be able to just change .js to .ts and it should work.

Since TypeScript is a super-set of ECMAScript 2015, which in turn is a super-set of ECMAScript 5, you can simply switch the file extensions from .js to .ts and everything will work just like it did before.

Sinan Samet
  • 6,432
  • 12
  • 50
  • 93

0 Answers0