Replace static content

Custom directive to replace static content

HTML

<h1>1. Replace static content</h1>

<div ng-app="myApp">
    <div ng-controller="myMovieCtrl">              
        <div my-movie></div>    
    </div>
</div>

JavaScript

'use strict';

/* App Module */

var app = angular.module("myApp", []);

app.controller("myMovieCtrl", function($scope) {
    $scope.movie = {name: "Roman Holiday", year: 1953, genre: "Comedy, Romance"};    
});

// Directives
app.directive('myMovie', function() {
  return {
      template: 'Name: {{movie.name}}, Genre: {{movie.genre}}, Year: {{movie.year}}'
    //templateUrl: 'my-movie.html'
  };
});