Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The kata is stuck at Node 8.
Design issue:
Angular
is already predefined and the tests expect the dependency graph to be cleared afterangular.bootstrap
for test reuse. But angular.bootstrap can only be used once anyway, so the kata is definitely not adhering to AngularJS standards.It should also be argued that
Angular
should be a class defined by the user, not in Preloaded, so we're not coming with our weird ways to keep track of dependencies in other global variables, and clearing the dependency graph by timing where one part of the test ends.(Speaking of which, currently when
angular.module
is called with dependencies it overwrites the existing dependency graph before doing validation. This is very unexpected; vaildation failure should not change the state of an object.)The order of the dependencies in
modules
array after bootstrap is not specified.Good kata with one very minor issue - the "Angular" constructor is locked, which makes it confusing to try to add a new property (for tracking dependencies). It is easy to workaround but may be worth mentioning in the description.
Thanks!
Good point! I have added that requirement. Thanks!
I think the tests should require a module to be added prior to bootstrap. It seems wrong that you can depend on a module that hasn't been added before bootstrapping.
The case in question is should bind profile to app, where a module is never defined but is depended on. Seems like the code should error on
bootstrap
in this case.Indeed this was intended, as pointed out in the description, a module can be defined once with the dependencies array, but can be used after without them to create other components. The test is trying to show the difference between:
angular.module('app', [])
and
angular.module('app').controller(function(){})
without overcomplicating things.
Fixed, thanks for the catch
The tests are not correct. Two times adding same module should throw an error, but inside the initial tests you are using that:
it('should be possible to use the module after creation', function(){
angular.module('app', []);
angular.module('app');
The tests and the initial solution are not working.
Inside the tests you are creating an instance from "Angular" and inside the initial solution you define methods of "angular".
Thank you!
Nice job: well commented, efficient, mantainable... Bravo!
Nice Kata!
translation to JS ready :)
Ops, rectius: the last regex was
/[A-Z][a-z]?/
, pardon.Loading more items...