Search Results

Search found 2 results on 1 pages for 'unludo'.

Page 1/1 | 1 

  • Unit-testing a directive with isolated scope and bidirectional value

    - by unludo
    I want to unit test a directive which looks like this: angular.module('myApp', []) .directive('myTest', function () { return { restrict: 'E', scope: { message: '='}, replace: true, template: '<div ng-if="message"><p>{{message}}</p></div>', link: function (scope, element, attrs) { } }; }); Here is my failing test: describe('myTest directive:', function () { var scope, compile, validHTML; validHTML = '<my-test message="message"></my-test>'; beforeEach(module('myApp')); beforeEach(inject(function($compile, $rootScope){ scope = $rootScope.$new(); compile = $compile; })); function create() { var elem, compiledElem; elem = angular.element(validHTML); compiledElem = compile(elem)(scope); scope.$digest(); return compiledElem; } it('should have a scope on root element', function () { scope.message = 'not empty'; var el = create(); console.log(el.text()); expect(el.text()).toBeDefined(); expect(el.text()).not.toBe(''); }); }); Can you spot why it's failing? The corresponding jsFiddle Thanks :)

    Read the article

  • High performance distributed asynchronous RPC in java

    - by unludo
    I would like to do RPC to a list of clients with the following requirements: the server does not know the clients (implies a kind of broker?) and the cleints do not know the server there may be several clients - they share the load to treat the RPC The RPC is asynchronous very fast (round-trip < 1ms) optional : offers a fail-over mechanism. It can be done with underlying tools which are not really intended for that (Hazelcast is an example). What would you use for such requirements? Thanks!

    Read the article

1