Widget dependency resolution using AngularJS