angular-material

How to get rid off Angular Material extra styles and CSS linked by it 'forcefully'

依然范特西╮ 提交于 2019-12-19 09:07:29
问题 I am using JSPM/SystemJS I am using Angular Material and extra lib for tables (which imports Angular Material too) I also would love to use SASS ONLY version of Angular Material by @import 'angular-material.scss' BUT when I do that and link my compiled app.css I get a lot extra from Angular Material: I get multiple <style> tags in the <head> with zillion of CSS styles (?????) I get TWO extra <links> in the <head> for each import of 'angular-material.js' package with SystemJS (one from my JS

angular-material change checkbox color

白昼怎懂夜的黑 提交于 2019-12-19 05:08:32
问题 I'm using checkbox of angular-material2. Currently the default color of checkbox is coming as purple color. Looks like they have changed default color of checkbox from "primary" to accent. Is there a way to get "primary"(green) color instead of purple without overriding css. I tried giving color="primary" to but that didn't worked. Code : <md-checkbox></md-checkbox> Import statement: import {MdCheckbox} from '@angular2-material/checkbox'; Plunker http://plnkr.co/edit/sFC0kfdzj7fxtUC3GXdr?p

NullInjectorError: No provider for ViewportScroller

让人想犯罪 __ 提交于 2019-12-19 05:06:53
问题 I'm building a simple angular application, using Angular Material to desing the front-end. The app just have 2 components rendered in the same page. When I serve the app, this is returned in the console: NullInjectorError: "StaticInjectorError(AppModule)[RouterScroller -> ViewportScroller]: StaticInjectorError(Platform: core)[RouterScroller -> ViewportScroller]: NullInjectorError: No provider for ViewportScroller!" AppModule.ts import { BrowserModule } from '@angular/platform-browser'; import

'mat-toolbar' is not a known element - Angular 5

旧时模样 提交于 2019-12-18 18:51:23
问题 I have created a new project, and I am trying to add angular-material . I have created material.module.ts in my app folder: import { NgModule } from '@angular/core'; import { MatButtonModule, MatMenuModule, MatIconModule, MatCardModule, MatSidenavModule, MatFormFieldModule, MatInputModule, MatTooltipModule, MatToolbarModule } from '@angular/material'; @NgModule({ imports: [ MatButtonModule, MatMenuModule, MatIconModule, MatCardModule, MatSidenavModule, MatFormFieldModule, MatInputModule,

Is it possible to make an md-button smaller?

南笙酒味 提交于 2019-12-18 18:36:15
问题 I want my buttons showing left- and right arrow and NOW text to be as small as possible. How do I do that? <div ng-controller="DateCtrl" layout="row" flex> <md-datepicker ng-model="activeDate" md-placeholder="Enter date" ng-change="changeDate()"></md-datepicker> <div> <md-button class="md-raised" ng-click="prev()"><</md-button> <md-button class="md-raised" ng-click="changeToday()">NOW</md-button> <md-button class="md-raised" ng-click="next()">></md-button> </div> </div> With the current

How to create multiple theme in material angular?

坚强是说给别人听的谎言 提交于 2019-12-18 17:03:37
问题 I want apply blue, light blue, green and ornage shade in my appication.I am using material angular theme part.But not getting exactly how to use..i have to create css ?? or js or directive.. 回答1: 1.) First go through theme documentation here 2.) Pick colors from palette (link) 3.) Create yr own custom theme with colors you want and define it inside app.config. app.config(function($mdThemingProvider) { $mdThemingProvider.theme('default') .primaryPalette('blue') .accentPalette('indigo')

Can't get angular-material md-sidenav to be 100% height

 ̄綄美尐妖づ 提交于 2019-12-18 12:45:15
问题 I'm making a new angular2 application using angular2-material with a sidenav. And I can't for the life of me get that sidenav to have a height of 100%. I'm trying to get a menu to slide out that takes up the whole height of the screen. And I want it to open the same way no matter where the user has scrolled. Here is my template: <md-sidenav-layout class="demo-sidenav-layout"> <md-sidenav #start mode="over"> <a [routerLink]="['/login']" class="btn btn-primary">Log in</a> <br> </md-sidenav> <md

Angular Material : How to make content scrollable

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 11:52:37
问题 I am using angular material and want to design a layout for my application. <!DOCTYPE html> <html lang="en"> <head> <title>Angular Material - Starter App</title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content=""> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"/> <link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Roboto:400,700'> <link rel="stylesheet" href="https://cdnjs

How to use paginator from material angular?

杀马特。学长 韩版系。学妹 提交于 2019-12-18 10:41:17
问题 I'm new to angular and trying to implement pagination in my app. I am trying to use this material component. With the code below, I can get length , pagesize , and pageSizeOptions in my .ts file <md-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" </md-paginator> export class PaginatorConfigurableExample { length = 100; pageSize = 10; pageSizeOptions = [5, 10, 25, 100]; } } but I can't seem to trigger a function to change the data on the table above when

Custom Controls with Reactive Forms

跟風遠走 提交于 2019-12-18 09:53:33
问题 I am using Angular 7, Angular Material controls with Reactive Forms. I created custom text (matInput type="text"), number (matInput type="number"), select (matSelect) controls with Angular Material with mat-form-field Here is the stackblitz for my example. I am trying to attach the custom form controls to reactive form and trying to fire any validations on the form group automatically. I am using ControlValueAccessor to achieve this, however my Select is not being identified as form control