-
Notifications
You must be signed in to change notification settings - Fork 764
Conversation
src/lib/api/directionality.ts
Outdated
/** The current 'ltr' or 'rtl' value. */ | ||
readonly value: Direction = 'ltr'; | ||
|
||
constructor(@Optional() @Inject(DIR_DOCUMENT) _document?: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you're not importing the DOCUMENT
token from angular/common
? This is why Travis is failing on prerender, it doesn't have access to the global browser document
object
20334be
to
bfb85cc
Compare
The @angular/cdk was only in dev dependencies (for the demo, I think). I've moved it to the dependency list and am now using the Directionality injectable from the bidi module. |
Excellent, I thought it was in the deps because it's available in the rollup globals, but I guess it was left out (this just means you need to do less work to include the cdk). |
FYI - current broken test is also failing in master |
Rebase with master should fix broken test |
bfb85cc
to
79790c9
Compare
Done, thanks. |
Friendly post-holiday ping. Anything that needs to be done to get this merged? RTL support is pretty important to my team. |
It would be great if you could add a demo that displays RTL in the demo-app, just something simple that documents the capability. Also, please change your commit message to something in line with the Angular contribution guidelines, found here Finally, the PR lists this as a partial fix for #274, are there cases that this does not cover, and can you list that in the commit message? Other than that the PR LGTM, I'll see what I can do to get it merged in the next week or so (it has to go through internal presubmit tests first) |
Updated commit message (I think). The "partial fix" in the description was from when I wasn't using the angular cdk dir directive. This should be a full fix of what was requested in that bug. I haven't looked much yet at where to put this in the demo app. I wasn't able to get the demo app running. |
You need to squash your commits into one with a rebase. If there is an issue with the demo-app, can you post it as a new issue so we can take a look? Also the scope can be empty, i.e. |
c719fea
to
925216c
Compare
Rebased and filed #547 |
925216c
to
3fdc411
Compare
Added the demo and updated the implementations to subscribe to the direction changes. |
src/lib/api/flexbox/layout-gap.ts
Outdated
super(monitor, elRef, renderer); | ||
|
||
if (container) { // Subscribe to layout direction changes | ||
this._layoutWatcher = container.layout$.subscribe(this._onLayoutChange.bind(this)); | ||
} | ||
|
||
this._directionWatcher = | ||
this._directionality.change.subscribe(() => this._updateWithValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the same as the _layoutWatcher subscription:
this._directionality.change.subscribe(this._updateWithValue.bind(this));
Demo looks great, thanks 👍 |
3fdc411
to
bb700dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @atscott, I've discussed this with @ThomasBurleson and here's what we need you to do:
- Clean up this PR (rebase/refactor as necessary)
- Clone the BiDi code from the CDK since it's low-complexity (and remove the explicit dependency)
- We'll get this in for the beta.14 release at the beginning of next month
8aa085d
to
30bf807
Compare
8737be3
to
1433946
Compare
@atscott - The reason we want to clone the Directionality class is to avoid introducing an explicit dependency on the CDK at this time.
|
453062b
to
5727752
Compare
Copy bidi module from angular material cdk so there's not a new dependency.
5727752
to
818ce91
Compare
Alright, that sounds good. I made those changes (had trouble rebasing so kind of redid the whole thing) and I think everything's all set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes #274