docs: function getOrCreateInjectable(di, token, flags) {
      if (flags === void 0) { flags = 0 /* Default */; }
      var bloomHash = bloomHashBit(token);
      // If the token has a bloom hash, then it is a directive that is public to the injection system
      // (diPublic). If there is no hash, fall back to the module injector.
      if (bloomHash === null) {
          var moduleInjector = getPreviousOrParentNode().view[INJECTOR$1];
          var formerInjector = setCurrentInjector(moduleInjector);
          try {
              return inject(token, flags);
          }
          finally {
              setCurrentInjector(formerInjector);
          }
      }
      else {
          var injector = di;
          while (injector) {
              // Get the closest potential matching injector (upwards in the injector tree) that
              // *potentially* has the token.
              injector = bloomFindPossibleInjector(injector, bloomHash, flags);
              // If no injector is found, we *know* that there is no ancestor injector that contains the
              // token, so we abort.
              if (!injector) {
                  break;
              }
              // At this point, we have an injector which *may* contain the token, so we step through the
              // directives associated with the injector's corresponding node to get the directive instance.
              var node = injector.node;
              var nodeFlags = node.tNode.flags;
              var count = nodeFlags & 4095 /* DirectiveCountMask */;
              if (count !== 0) {
                  var start = nodeFlags >> 14 /* DirectiveStartingIndexShift */;
                  var end = start + count;
                  var defs = node.view[TVIEW].directives;
                  for (var i = start; i < end; i++) {
                      // Get the definition for the directive at this index and, if it is injectable (diPublic),
                      // and matches the given token, return the directive instance.
                      var directiveDef = defs[i];
                      if (directiveDef.type === token && directiveDef.diPublic) {
                          return node.view[DIRECTIVES][i];
                      }
                  }
              }
              // If we *didn't* find the directive for the token and we are searching the current node's
              // injector, it's possible the directive is on this node and hasn't been created yet.
              var instance = void 0;
              if (injector === di && (instance = searchMatchesQueuedForCreation(node, token))) {
                  return instance;
              }
              // The def wasn't found anywhere on this node, so it was a false positive.
              // If flags permit, traverse up the tree and continue searching.
              if (flags & 2 /* Self */ || flags & 1 /* Host */ && !sameHostView(injector)) {
                  injector = null;
              }
              else {
                  injector = injector.parent;
              }
          }
      }
      // No directive was found for the given token.
      if (flags & 8 /* Optional */)
          return null;
      throw new Error("Injector: NOT_FOUND [" + stringify$1(token) + "]");
  }