Created
June 13, 2014 07:47
-
-
Save jeserkin/186a085a88510be03b35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
}; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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