-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Add NgModules for material #950
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
Merged
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4f43c88
mostly works
jelbourn cc6031f
fix dialog, tabs, and list
jelbourn 7024d51
fix broken tests due to bad module definitions
jelbourn dd17561
fix weird async errors
jelbourn 3bddddb
version bump
jelbourn 38638f0
testing changes?
jelbourn f29dbf2
tests pass with new testing APIs
jelbourn 5468db8
remove unused imports
jelbourn 9212d58
add logs for debuggin
jelbourn c942c86
remove console.log
jelbourn e665162
clean up modules
jelbourn 84a0a9f
button-tgoggle-demo scss
jelbourn 022037a
add sleep to staging script
jelbourn 74f7510
wip ngc
jelbourn c29a031
fix incorrectly private members
jelbourn 123b410
undo ngc config changes
jelbourn a3f96ec
workaround for #10503
jelbourn 78b97f0
workaround for tabs test
jelbourn 6273f3f
fix e2e app
jelbourn ecbb4f4
export core modules and add MdCoreModule
jelbourn 02a27af
add more spacing around menu triggers
jelbourn e2c55f5
remove TEST_COMPONENTS
jelbourn 0808f49
Clean up leftovers from debugging
jelbourn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,59 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {MdButtonToggleModule} from '@angular2-material/button-toggle/button-toggle'; | ||
import {MdButtonModule} from '@angular2-material/button/button'; | ||
import {MdCheckboxModule} from '@angular2-material/checkbox/checkbox'; | ||
import {MdRadioModule} from '@angular2-material/radio/radio'; | ||
import {MdSlideToggleModule} from '@angular2-material/slide-toggle/slide-toggle'; | ||
import {MdSliderModule} from '@angular2-material/slider/slider'; | ||
import {MdSidenavModule} from '@angular2-material/sidenav/sidenav'; | ||
import {MdListModule} from '@angular2-material/list/list'; | ||
import {MdGridListModule} from '@angular2-material/grid-list/grid-list'; | ||
import {MdCardModule} from '@angular2-material/card/card'; | ||
import {MdIconModule} from '@angular2-material/icon/icon'; | ||
import {MdProgressCircleModule} from '@angular2-material/progress-circle/progress-circle'; | ||
import {MdProgressBarModule} from '@angular2-material/progress-bar/progress-bar'; | ||
import {MdInputModule} from '@angular2-material/input/input'; | ||
import {MdTabsModule} from '@angular2-material/tabs/tabs'; | ||
import {MdToolbarModule} from '@angular2-material/toolbar/toolbar'; | ||
import {MdTooltipModule} from '@angular2-material/tooltip/tooltip'; | ||
import {MdRippleModule} from '@angular2-material/core/ripple/ripple'; | ||
import {PortalModule} from '@angular2-material/core/portal/portal-directives'; | ||
import {OverlayModule} from '@angular2-material/core/overlay/overlay-directives'; | ||
import {MdMenuModule} from '@angular2-material/menu/menu'; | ||
import {MdDialogModule} from '@angular2-material/dialog/dialog'; | ||
import {RtlModule} from '@angular2-material/core/rtl/dir'; | ||
import {MdLiveAnnouncer} from '@angular2-material/core/a11y/live-announcer'; | ||
|
||
|
||
const MATERIAL_MODULES = [ | ||
MdButtonModule, | ||
MdButtonToggleModule, | ||
MdCardModule, | ||
MdCheckboxModule, | ||
MdDialogModule, | ||
MdGridListModule, | ||
MdIconModule, | ||
MdInputModule, | ||
MdListModule, | ||
MdMenuModule, | ||
MdProgressBarModule, | ||
MdProgressCircleModule, | ||
MdRadioModule, | ||
MdRippleModule, | ||
MdSidenavModule, | ||
MdSliderModule, | ||
MdSlideToggleModule, | ||
MdTabsModule, | ||
MdToolbarModule, | ||
MdTooltipModule, | ||
OverlayModule, | ||
PortalModule, | ||
RtlModule, | ||
]; | ||
|
||
@NgModule(({ | ||
imports: MATERIAL_MODULES, | ||
exports: MATERIAL_MODULES, | ||
providers: [MdLiveAnnouncer] | ||
})) | ||
export class MaterialModule { } |
This file contains hidden or 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 |
---|---|---|
@@ -1,40 +1,35 @@ | ||
import { | ||
addProviders, | ||
inject, | ||
async, | ||
fakeAsync, | ||
tick, | ||
TestComponentBuilder, | ||
ComponentFixture, | ||
TestBed, | ||
} from '@angular/core/testing'; | ||
import {NgControl, disableDeprecatedForms, provideForms} from '@angular/forms'; | ||
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing'; | ||
import {NgControl, FormsModule} from '@angular/forms'; | ||
import {Component, DebugElement} from '@angular/core'; | ||
import {By} from '@angular/platform-browser'; | ||
import { | ||
MD_BUTTON_TOGGLE_DIRECTIVES, | ||
MdButtonToggleGroup, | ||
MdButtonToggle, | ||
MdButtonToggleGroupMultiple, | ||
MdButtonToggleChange, | ||
MdButtonToggleGroup, | ||
MdButtonToggle, | ||
MdButtonToggleGroupMultiple, | ||
MdButtonToggleChange, MdButtonToggleModule, | ||
} from './button-toggle'; | ||
import { | ||
MdUniqueSelectionDispatcher | ||
} from '@angular2-material/core/coordination/unique-selection-dispatcher'; | ||
|
||
|
||
describe('MdButtonToggle', () => { | ||
let builder: TestComponentBuilder; | ||
let dispatcher: MdUniqueSelectionDispatcher; | ||
|
||
beforeEach(() => { | ||
addProviders([ | ||
disableDeprecatedForms(), | ||
provideForms(), | ||
{provide: MdUniqueSelectionDispatcher, useFactory: () => { | ||
dispatcher = new MdUniqueSelectionDispatcher(); | ||
return dispatcher; | ||
}} | ||
]); | ||
}); | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [MdButtonToggleModule, FormsModule], | ||
declarations: TEST_COMPONENTS, | ||
}); | ||
|
||
|
||
TestBed.compileComponents(); | ||
})); | ||
|
||
beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { | ||
builder = tcb; | ||
|
@@ -439,7 +434,6 @@ describe('MdButtonToggle', () => { | |
|
||
|
||
@Component({ | ||
directives: [MD_BUTTON_TOGGLE_DIRECTIVES], | ||
template: ` | ||
<md-button-toggle-group [disabled]="isGroupDisabled" [value]="groupValue"> | ||
<md-button-toggle value="test1">Test1</md-button-toggle> | ||
|
@@ -454,7 +448,6 @@ class ButtonTogglesInsideButtonToggleGroup { | |
} | ||
|
||
@Component({ | ||
directives: [MD_BUTTON_TOGGLE_DIRECTIVES], | ||
template: ` | ||
<md-button-toggle-group [(ngModel)]="modelValue" (change)="lastEvent = $event"> | ||
<md-button-toggle *ngFor="let option of options" [value]="option.value"> | ||
|
@@ -474,7 +467,6 @@ class ButtonToggleGroupWithNgModel { | |
} | ||
|
||
@Component({ | ||
directives: [MD_BUTTON_TOGGLE_DIRECTIVES], | ||
template: ` | ||
<md-button-toggle-group [disabled]="isGroupDisabled" multiple> | ||
<md-button-toggle value="eggs">Eggs</md-button-toggle> | ||
|
@@ -488,9 +480,15 @@ class ButtonTogglesInsideButtonToggleGroupMultiple { | |
} | ||
|
||
@Component({ | ||
directives: [MD_BUTTON_TOGGLE_DIRECTIVES], | ||
template: ` | ||
<md-button-toggle>Yes</md-button-toggle> | ||
` | ||
}) | ||
class StandaloneButtonToggle { } | ||
|
||
const TEST_COMPONENTS = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are only used once, please inline them. |
||
ButtonTogglesInsideButtonToggleGroup, | ||
ButtonToggleGroupWithNgModel, | ||
ButtonTogglesInsideButtonToggleGroupMultiple, | ||
StandaloneButtonToggle, | ||
]; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 too many parenthesis here?