Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AngularJS An Introduction to Directives Directives: Dynamic scope property

Update index.html to use the dynamic scope property title for the value of the course-title attribute.

Hi guys,

Really struggling with this one. Any ideas where I'm going wrong?

Any help would be much appreciated.

Thanks

James

index.html
<!DOCTYPE html>
<html ng-app="myApp">
<head>
  <title>{{ $attrs.courseTitle }}</title>
  <script src="js/angular.js"></script>
  <script src="app.js"></script>
</head>
<body ng-controller="myController">

  <div treehouse-course course-title="Intro to Angular"></div>

</body>
</html>

1 Answer

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

James;

You need to set the course-title, which right now is hard coded to "Intro to Angular" to the dynamic scope property title. That would look like:

<div treehouse-course course-title={{title}}></div>

Hope it helps and happy coding,

Ken