Skip to content

Instantly share code, notes, and snippets.

@jeserkin
Created June 13, 2014 07:47
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 jeserkin/186a085a88510be03b35 to your computer and use it in GitHub Desktop.
Save jeserkin/186a085a88510be03b35 to your computer and use it in GitHub Desktop.
angular.module('sampleAbc', [])
.directive('subSampleAbc', function() {
restrict: 'E',
template: '<h1>Who are you doing {{person.name}}?</h1>',
controller: function($scope, $element, $attrs, $transclude) {
$scope.person = {
name: 'John Alden'
};
}
});
describe('Module: sampleAbc', function() {
var $scope, $compile;
beforeEach(module('sampleAbc'));
beforeEach(inject(function ($rootScope, _$compile_) {
$scope = $rootScope;
$compile = _$compile_;
}));
describe('Directive: subSampleAbc', function() {
it('should return template', function() {
var person = {
name: 'John Alden'
};
console.log(person);
console.log($scope.person);
//var element = $compile('<sub-sample-abc></sub-sample-abc>')($scope);
//$scope.$digest();
expect(person).toEqual($scope.person);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment