Exercise
Correct!
var app = angular.module('app', []);
app.provider('movie', function () {
var version;
return {
code_hear: function (value) {
version = value;
},
code_hear
code_hear
code_hear
}
}
}
});
app.code_hear(function (code_hear) {
code_hear
});
app.controller('MyController', function (movie) {
$scope.movie = movie.title;
});
var app = angular.module('app', []);
app.provider('movie', function () {
var version;
return {
setVersion: function (value) {
version = value;
},
$get: function () {
return {
title: 'The Matrix' + ' ' + version
}
}
}
});
app.config(function (movieProvider) {
movieProvider.setVersion('Reloaded');
});
app.controller('MyController', function (movie) {
$scope.movie = movie.title;
});
assert(line4 == l4); //assert(line7 == l7); //assert(line8 == l8); //assert(line9 == l9); //assert(line15 == l15); //assert(line16 == l16);
function rpls(str){
return str.toLowerCase().replace(/'/g,'').replace(/ /g, '');
}
var l4 = rpls("setVersion: function (value) {");
var l7 = rpls("$get: function () {");
var l8 = rpls("return {");
var l9 = rpls("title: 'The Matrix' + ' ' + version");
var l16 = rpls("app.config(function (movieProvider) {");
var l17 = rpls("movieProvider.setVersion('Reloaded');");