-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
md-icon #281
md-icon #281
Conversation
} | ||
|
||
@Injectable() | ||
export class MdIconProvider { |
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.
I'm trying to come up with a better name for this class, since it would be good to move away from the Angular 1 "provider" concept. What do you think about MdIconRegistry
?
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.
SG
* Sets the CSS class name to be used for icon fonts when an <md-icon> component does not | ||
* have a fontSet input value, and is not loading an icon by name or URL. | ||
*/ | ||
setDefaultFontSetClass(className: string) { |
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.
Missing return value type (this
)
return this._inProgressUrlFetches.get(url); | ||
} | ||
const req = this._http.get(url) | ||
.map((response) => response.text()) |
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.
Forget the whole thing. Apparently HTTP doesn't have a way to do that.
Note that a flatMap
might be a good idea if the server returns multiple elements.
|
||
@Component({ | ||
selector: 'test-app', | ||
template: `<md-icon aria-label="{{ariaLabel}}" alt="{{altText}}">{{iconName}}</md-icon>`, |
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.
One last comment:
for all these tests where you're using the {{ }}
inside the attribute value, they should instead use the [ ]
syntax, e.g.:
<md-icon [attr.aria-label]="ariaLabel" [alt]="altText">{{iconName}}</md-icon>
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.
Done. Incidentally the documentation slightly leans toward interpolation: https://angular.io/docs/ts/latest/guide/template-syntax.html#!#property-binding
There is no technical reason to prefer one form to the other. We lean toward readability, which tends to favor interpolation.
LGTM aside from those last two minor comments. |
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. |
Preview PR for md-icon. Doc at https://docs.google.com/a/google.com/document/d/1zWTjnSLFPV4II9IxpIehyeSFtnzw_efdy7kEerMRIuo/edit?usp=sharing