Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamicComponentLoader.loadIntoNewLocation: Should be usable with any ElementRef ... #2472

Closed
matanlurey opened this issue Jun 10, 2015 · 1 comment · Fixed by #2571
Closed

Comments

@matanlurey
Copy link
Contributor

not just with a component's ElementRef.

For example:

@Directive()
class ReferenceDirective {
  ReferenceDirective(DynamicComponentLoader dcl, ElementRef ref) {
    dcl.loadIntoNewLocation(... ref) // Throws right now
  }
}

Workaround:

var elementInjector = internalView(elementRef.parentView)
    .elementInjectors[elementRef.boundElementIndex];
var hostComponentElementRef = elementInjector.getHost()
    .getElementRef();

I'm denoting P3, because there is a simple enough workaround that can be hidden away in a utility class, but I may bump if others run into the same issue.

@tbosch tbosch added this to the alpha-28 milestone Jun 15, 2015
tbosch added a commit to tbosch/angular that referenced this issue Jun 16, 2015
…edded views

Closes angular#2472
Closes angular#2339

BREAKING CHANGE
- `DynamicComponentLoader.loadInto{Existing,New}Location` is removed
  * use `DynamicComponentLoader.loadNextToLocation` instead
- `DynamicComponentLoader.loadNextToExistingLocation` was renamed into
  `DynamicComponentLoader.loadNextToLocation`
- `AppViewManager.{create,destroy}Free{Host,Embedded}View` was removed
  * use `AppViewManager.createViewInContainer` and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
tbosch added a commit to tbosch/angular that referenced this issue Jun 16, 2015
…edded views

Closes angular#2472
Closes angular#2339

BREAKING CHANGE
- `DynamicComponentLoader.loadInto{Existing,New}Location` is removed
  * use `DynamicComponentLoader.loadNextToLocation` instead
- `DynamicComponentLoader.loadNextToExistingLocation` was renamed into
  `DynamicComponentLoader.loadNextToLocation`
- `AppViewManager.{create,destroy}Free{Host,Embedded}View` was removed
  * use `AppViewManager.createViewInContainer` and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
tbosch added a commit to tbosch/angular that referenced this issue Jun 16, 2015
…edded views

Closes angular#2472
Closes angular#2339

BREAKING CHANGE
- `DynamicComponentLoader.loadInto{Existing,New}Location` is removed
  * use `DynamicComponentLoader.loadNextToLocation` instead
- `DynamicComponentLoader.loadNextToExistingLocation` was renamed into
  `DynamicComponentLoader.loadNextToLocation`
- `AppViewManager.{create,destroy}Free{Host,Embedded}View` was removed
  * use `AppViewManager.createViewInContainer` and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
tbosch added a commit to tbosch/angular that referenced this issue Jun 17, 2015
…edded views

Closes angular#2472
Closes angular#2339

BREAKING CHANGE
- `Compiler.compile` has been removed, the only way to compile
  components dynamically is via `Compiler.compileInHost`
- `DynamicComponentLoader.loadIntoExistingLocation` has changed:
  * renamed into `loadIntoLocation`
  * will always create the host element as well
  * requires an element with a variable inside of the host component view
    next to which it will load new component.
- `DynamicComponentLoader.loadNextToExistingLocation` was renamed into
  `DynamicComponentLoader.loadNextToLocation`
- `DynamicComponentLoader.loadIntoNewLocation` is removed
  * use `DynamicComponentLoader.loadNextToLocation` instead
    and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
- `AppViewManager.{create,destroy}Free{Host,Embedded}View` was removed
  * use `AppViewManager.createViewInContainer` and then move the view nodes
    manually around via `DomRenderer.getRootNodes()`
- `Renderer.detachFreeView` was removed. Use `DomRenderer.getRootNodes()`
  to get the root nodes of a view and detach them manually.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants