Skip to content

function AlbumListController doesnt work in 1.4 #1

@bhajanpreets

Description

@bhajanpreets

I was practicing the live lessons and found that I was unable to run 01_controller.html with Angular 1.4.8.

I had to replace the way function is defined. (I checked https://docs.angularjs.org/tutorial/step_02)

Replaced,

<script type="text/javascript">
    function AlbumListController($scope){
        $scope.albums = [ 
            ... ];
    }
</script>

by

<script type="text/javascript">
    var albumsApp = angular.module( 'albumsApp', [] );
    albumsApp.controller('AlbumListController', function($scope){
        $scope.albums = [ 
            ... ];
    });
</script>

Just adding a comment here hoping that it would help someone who encounters the same issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions