mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore(menu): add basic scaffold for menu (#808)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
it,
|
||||
describe,
|
||||
expect,
|
||||
beforeEach,
|
||||
inject,
|
||||
} from '@angular/core/testing';
|
||||
import {TestComponentBuilder} from '@angular/compiler/testing';
|
||||
import {Component} from '@angular/core';
|
||||
import {By} from '@angular/platform-browser';
|
||||
|
||||
import {MD_MENU_DIRECTIVES} from './MENU';
|
||||
|
||||
describe('MdMenu', () => {
|
||||
let builder: TestComponentBuilder;
|
||||
|
||||
beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||
builder = tcb;
|
||||
}));
|
||||
|
||||
it('should add and remove focus class on focus/blur', () => {
|
||||
var template = ``;
|
||||
return builder.overrideTemplate(TestList, template)
|
||||
.createAsync(TestList).then((fixture) => {
|
||||
// expect(true).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@Component({
|
||||
selector: 'test-menu',
|
||||
template: ``,
|
||||
directives: [MD_MENU_DIRECTIVES]
|
||||
})
|
||||
class TestList {}
|
||||
@@ -0,0 +1,13 @@
|
||||
import {Component, ViewEncapsulation} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'md-menu',
|
||||
templateUrl: 'menu.html',
|
||||
styleUrls: ['menu.css'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class MdMenu {}
|
||||
|
||||
export const MD_MENU_DIRECTIVES = [MdMenu];
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@angular2-material/menu",
|
||||
"version": "2.0.0-alpha.6",
|
||||
"description": "Angular 2 Material menu",
|
||||
"main": "./menu.js",
|
||||
"typings": "./menu.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/angular/material2.git"
|
||||
},
|
||||
"keywords": [
|
||||
"angular",
|
||||
"material",
|
||||
"material design",
|
||||
"components",
|
||||
"menu"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/angular/material2/issues"
|
||||
},
|
||||
"homepage": "https://github.com/angular/material2#readme",
|
||||
"peerDependencies": {
|
||||
"@angular2-material/core": "2.0.0-alpha.6"
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
<a md-list-item [routerLink]="['icon']">Icon</a>
|
||||
<a md-list-item [routerLink]="['input']">Input</a>
|
||||
<a md-list-item [routerLink]="['list']">List</a>
|
||||
<a md-list-item [routerLink]="['menu']">Menu</a>
|
||||
<a md-list-item [routerLink]="['live-announcer']">Live Announcer</a>
|
||||
<a md-list-item [routerLink]="['overlay']">Overlay</a>
|
||||
<a md-list-item [routerLink]="['portal']">Portal</a>
|
||||
|
||||
@@ -20,6 +20,7 @@ import {SlideToggleDemo} from '../slide-toggle/slide-toggle-demo';
|
||||
import {SidenavDemo} from '../sidenav/sidenav-demo';
|
||||
import {RadioDemo} from '../radio/radio-demo';
|
||||
import {CardDemo} from '../card/card-demo';
|
||||
import {MenuDemo} from '../menu/menu-demo';
|
||||
|
||||
|
||||
|
||||
@@ -39,6 +40,7 @@ export const routes: RouterConfig = [
|
||||
{path: 'toolbar', component: ToolbarDemo},
|
||||
{path: 'icon', component: IconDemo},
|
||||
{path: 'list', component: ListDemo},
|
||||
{path: 'menu', component: MenuDemo},
|
||||
{path: 'live-announcer', component: LiveAnnouncerDemo},
|
||||
{path: 'gestures', component: GesturesDemo},
|
||||
{path: 'grid-list', component: GridListDemo},
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
menu
|
||||
@@ -0,0 +1,12 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {NgIf, NgFor} from '@angular/common';
|
||||
import {MD_MENU_DIRECTIVES} from '@angular2-material/menu/menu';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'menu-demo',
|
||||
templateUrl: 'menu-demo.html',
|
||||
styleUrls: ['menu-demo.css'],
|
||||
directives: [MD_MENU_DIRECTIVES]
|
||||
})
|
||||
export class MenuDemo {}
|
||||
@@ -13,6 +13,7 @@ const components = [
|
||||
'icon',
|
||||
'input',
|
||||
'list',
|
||||
'menu',
|
||||
'progress-bar',
|
||||
'progress-circle',
|
||||
'radio',
|
||||
|
||||
Reference in New Issue
Block a user