-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(compiler): support for content elements #9551
feat(compiler): support for content elements #9551
Conversation
@topherfangio, @ErinCoughlan - plz review. |
eaf4a6d
to
272e1be
Compare
LGTM. Definitely agree that the docs need some cleanup, but otherwise, I think this is good. |
* to easily compile an element with options like in a Directive Definition Object. | ||
* | ||
* > The compiler powers a lot of components inside of Angular Material. | ||
* > Like the `$mdPanel` or `$mdDialog`. |
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.
Hehe, this line is great. 💃
I'm fine with fixing the docs later, but some love would be nice.
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.
Hehe, I only have love available for the $$interimElement
stuff 😄
As planned, we are improving this in a follow-up PR
272e1be
to
9154af4
Compare
@topherfangio Yeah, as said I did not write most of the docs, and I wanted to keep this PR as clean as possible, since changes to the compiler are very dangerous.
|
*/ | ||
function MdCompilerService($q, $templateRequest, $injector, $compile, $controller) { | ||
/** @private @const {!angular.$q} */ | ||
this.$q = $q; |
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.
Probably down to preference, but if these are private, shouldn't they be prefixed with an underscore?
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.
Hm, I do not like to have them in the Prototype, we also don't have them in the chips.
I personally like them, when working with TypeScript and Getters (as a accumulator)
9154af4
to
42071c0
Compare
A couple of very minor notes, but otherwise LGTM. |
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
* @returns {{element: !JQLite, restore: !Function}} | ||
* @private | ||
*/ | ||
MdCompilerService.prototype.fetchContentElement = function(options) { |
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.
Private methods should have underscores in the name.
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.
Yeah I missed that one. Solved now!
42071c0
to
324d179
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.
LGTM
This moves the
contentElement
logic from the$mdDialog
(as introduced in 135cb3a) to the$mdCompiler
.This allows the
$mdPanel
to take advantage of this functionality and does not block the port of the dialog to the$mdPanel
FYI: Don't be too nitpicky about the docs, those were mostly not written by me (rather fix those in a new PR)
Base for #9366