Skip to content

Instantly share code, notes, and snippets.

@thebigredgeek
Created October 12, 2013 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebigredgeek/6946437 to your computer and use it in GitHub Desktop.
Save thebigredgeek/6946437 to your computer and use it in GitHub Desktop.
weird bug
/**
* This controller is used by youtubeItem directives
* @name angulartodo#youtubeItemController
* @param {Object} $scope An instance of $scope
* @param {Object} $attrs An object containing html attributes bound to this directive
*/
angular.module('angulartodo').controller('youtubeItemController',[
'$scope','$attrs',
function($scope, $attrs){
console.log("hello world!");
$scope.text = $attrs.text; //bind the text
}]);
/**
* This directive renders a youtube item for the todo list
* @name angulartodo#yotubeItem
* @return {Object} Directive definition
*/
angular.module('angulartodo').directive('youtubeItem',[
function(){
var definition = {}; // Definition prototype
definition.restrict = "E"; // This restricts the directive to an element form
definition.controller = "youtubeItemController"; // Use the youtubeItemController as the controller
definition.templateUrl = "directives/youtubeItem.html"; // Use the youtubeItem.html partial for the template
definition.link = angular.noop; // We aren't actually doing anything during the link, but we need to provide the member
return definition; // Return the definition
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment