As I follow along with the angularjs tutorial, I am attempting to replicate each step. In the section on routes, we are instructed to create a file called app.js. I am using SublimeText2 as my text editor, with both syntax settings set to javascript. Surprisingly, when comparing the two files (app.js and app2.js), they appear to contain identical code. However, only one of them is functioning correctly - app2.js works while app.js does not. Here is the output from my bash command:
$ diff app.js app2.js > diff.txt
3a4
>
5,7c6,8
< 'ngRoute',
< 'phonecatControllers'
< ]);
---
> 'ngRoute',
> 'phonecatControllers'
> ]);
10,23c11,24
< function($routeProvider) {
< $routeProvider.
< when('/phones', {
< templateURL: 'partials/phone-list.html',
< controller: 'PhoneListCtrl'
< }).
< when('/phones/:phoneId', {
< templateURL: 'partials/phone-detail.html',
< controller: 'PhoneDetailCtrl'
< }).
< otherwise({
< redirectTo:'/phones'
< });
< }]);
\ No newline at end of file
---
> function($routeProvider) {
> $routeProvider.
> when('/phones', {
> templateUrl: 'partials/phone-list.html',
> controller: 'PhoneListCtrl'
> }).
> when('/phones/:phoneId', {
> templateUrl: 'partials/phone-detail.html',
> controller: 'PhoneDetailCtrl'
> }).
> otherwise({
> redirectTo: '/phones'
> });
> }]);
I am seeking assistance in pinpointing the discrepancies between the two files. Could it be possible that the spaces in JavaScript play a crucial role, unlike Python where indentation is significant?