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

fix(angular1_router): support templateUrl components #6978

Closed

Conversation

petebacondarwin
Copy link
Member

Closes #4633

@petebacondarwin petebacondarwin added type: bug/fix cla: yes comp: router action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 10, 2016
@btford
Copy link
Contributor

btford commented Feb 10, 2016

Can you rebase?

controller: getController(options),
}
};
if (options.template) definition.template = options.template;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put this in a block?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right-oh!

@btford
Copy link
Contributor

btford commented Feb 10, 2016

ping @brandonroberts in case he has insights

@petebacondarwin
Copy link
Member Author

@btford I have updated, rebase and split the PR into three commits.
The third commit is new and renames $router service to $rootRouter.

@btford btford added pr_state: LGTM action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 11, 2016
@btford
Copy link
Contributor

btford commented Feb 16, 2016

@petebacondarwin
Copy link
Member Author

@btford rebased and fixed formatting issue

@petebacondarwin petebacondarwin force-pushed the router-templateUrl branch 2 times, most recently from d8d2237 to 0c679fc Compare February 17, 2016 07:56
@princemaple
Copy link

Is this done? Is it the last blocker for angular1 router?

@petebacondarwin
Copy link
Member Author

We are waiting on it being merged into master.

The current router is passed to the current component via a binding.
To indicate that this is an angular provided object, this commit
renames the binding to `$router`.

BREAKING CHANGE:

The recently added binding of the current router to the current component
has been renamed from `router` to `$router`.

So now the recommended set up for your bindings in your routed component
is:

```js
{
  ...
  bindings: {
    $router: '<'
  }
}
```
The singleton service that represents the top level router was called
`$router` but this is confusing since there are actually lots of routers,
which depend upon where you are in the DOM. This is similar to the situation
with scopes.

This commit clarifies this singleton by renaming it to `$rootRouter`.

BREAKING CHANGE:

The `$router` injectable service has been renamed to `$rootRouter`
This binding is never going to change so we can make it a one-time binding
@mary-poppins
Copy link

Merging PR #6978 on behalf of @vsavkin to branch presubmit-vsavkin-pr-6978.

@petebacondarwin
Copy link
Member Author

Woohoo

@char0n
Copy link

char0n commented Feb 25, 2016

Could somebody please provide built ngComponentRouter in ES5 ? Or direct my to the docs where I can find how to build it.

Thanks

PS: really great job ! ;]

@brandonroberts
Copy link
Contributor

@char0n See: angular/angular.js#12926 (comment) or use Pete's build from the sample repo

@alexgoldstone
Copy link

@char0n Also see angular/angular.js#12926 (comment) for installing via npm.

@char0n
Copy link

char0n commented Feb 25, 2016

@brandonroberts, @alexgoldstone : thanks. Will try tommorow

@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 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ComponentRouter] templateUrl and lifecycle hook in Angular 1
8 participants