forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove hard dependency on @angular/http
* Makes `@angular/http` an optional dependency since it is only being used by the icon module. An error will be thrown only if the user runs into something that requires the `HttpModule`. * Moves the various icon error classes into `icon-errors.ts`. * Moves the icon registry provider next to the registry itself, instead of in the same file as the icon directive. Fixes angular#2616.
- Loading branch information
Showing
7 changed files
with
114 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {MdError} from '../core'; | ||
|
||
/** | ||
* Exception thrown when attempting to load an icon with a name that cannot be found. | ||
* @docs-private | ||
*/ | ||
export class MdIconNameNotFoundError extends MdError { | ||
constructor(iconName: string) { | ||
super(`Unable to find icon with the name "${iconName}"`); | ||
} | ||
} | ||
|
||
/** | ||
* Exception thrown when attempting to load SVG content that does not contain the expected | ||
* <svg> tag. | ||
* @docs-private | ||
*/ | ||
export class MdIconSvgTagNotFoundError extends MdError { | ||
constructor() { | ||
super('<svg> tag not found'); | ||
} | ||
} | ||
|
||
/** | ||
* Exception thrown when the consumer attempts to use `<md-icon>` without including @angular/http. | ||
* @docs-private | ||
*/ | ||
export class MdIconNoHttpProviderError extends MdError { | ||
constructor() { | ||
super('Could not find Http provider for use with Angular Material icons. ' + | ||
'Please include the HttpModule from @angular/http in your app imports.'); | ||
} | ||
} | ||
|
||
/** | ||
* Exception thrown when an invalid icon name is passed to an md-icon component. | ||
* @docs-private | ||
*/ | ||
export class MdIconInvalidNameError extends MdError { | ||
constructor(iconName: string) { | ||
super(`Invalid icon name: "${iconName}"`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters