angulardart / angular_components

The official Material Design components for AngularDart. Used at Google in production apps.
https://pub.dev/packages/angular_components
372 stars 123 forks source link

Cannot select material-select items #441

Closed GowthamF closed 5 years ago

GowthamF commented 5 years ago

I wanna use Material-Select in my web application. I implemented the Material-Select like this. `

Simple single selection

<material-dropdown-select buttonText="{{selectedValue}}" [(selection)]="selectedValue" [options]="values">
</material-dropdown-select>

`

`import 'package:angular/angular.dart'; import 'package:angular_components/angular_components.dart';

@Component( selector: 'home-component', providers: [popupBindings], templateUrl: 'home_component.html', styleUrls: ['home_component.scss.css'], directives: [MaterialDropdownSelectComponent], ) class HomeComponent { final values = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; int selectedValue = 1; }`

`@import 'package:angular_components/css/material/material'; @import 'package:angular_components/css/material/shadow';

.example { @include shadow-elevation(2); margin-bottom: $mat-grid 3; padding: $mat-grid 2; max-width: $mat-grid * 84;

&.example-with-options { display: flex; } }

.example-pane { flex: 1;

material-dropdown-select { width: $mat-grid 25; padding: $mat-grid 2 0; } }

.options-pane { flex: 1; padding: $mat-grid * 2; background: $mat-gray-200;

material-checkbox { margin-left: 0; } }`

When I am selecting it, I am getting the following error. I am unable to select any element also. dropdown

nshahan commented 5 years ago

I can see some typos in this code like @component instead of @Component but it is hard to tell if that is because of the lack of formatting. Github supports the triple tick ``` syntax for marking code blocks. Just put three tick marks on the line before and the line after code you are posting to format it like code.

That said, this is a question that would be better for [stack overflow] (https://stackoverflow.com/questions/tagged/angular-dart). Have you tried posting your question there?

GowthamF commented 5 years ago

Yes I have posted it in the Stackoverflow also. I haven't got any answers. One more thing to say, I don't get any exception when I build and run. Only problem when running on Webdev serve.

GowthamF commented 5 years ago

I will close this since it has been resolved after installing Dart SDK 2.5.0. Previously I was using Dart SDK from Flutter.