AngularJS directives have their own scope, your list is generated using ng-repeat, right? That's why
"Course.SelectedCourse = Course.ID"
doesnโt work because inside the ng-repeat div the $ scope loop is executed. Theourse is created locally and does not match what is in your main controller. In addition, functions from the main controller can be called with directives, so the previous answer works.
source share