Comments (6)
Added basic functionality in fbf7bfc
from angular-schema-form-material.
Not sure if something changed, but I had to double escape the single quotes in md-items in the autocomplete.html file.
md-items="item in evalExpr('this[\\''+form.optionFilter+'\\'](\\''+searchText+'\\')')"
from angular-schema-form-material.
@brianpkelley it may have, which version of MD did you run with?
from angular-schema-form-material.
Angular 1.5.6
Angular Material 1.0.9
Angular Schema Form 0.8.13
Angular Schema Form Material current Develop branch
I also commented on #11 not sure if it notified you.
from angular-schema-form-material.
Disclaimer
Sorry for spamming code everywhere, I'd love to pull down a fresh copy but just don't have the time right now. Rushing to get a project out the door for work, so I'm posting these as notes for anyone with time or for when I get time to issue clean PR's
In the same vein as #18, md-autocomplete (and other fields that are of type object
) pass null to the validator when empty. I may be wrong, and this is intended behavior, but this should be set to undefined like on empty strings, numbers etc.
// Object fields (material - autocomplete ) will give a null value when we're looking for an object or undefined
if (schema.type === 'object' && value === null) {
value = undefined;
}
I know this is still a work in progress, but I needed to make a few changes to the md-autocopmlete template to work with errors. Because the md-autocomplete
directive creates it's own md-input-container
sf-messages
needs to be moved from the container div
to the inner md-autocomplete
as well as an option for md-required-match
if ( args.form.schema.requireMatch ) {
mdAutocompleteFrag.setAttribute('md-require-match', true);
}
<div class="form-group {{::form.htmlClass ? form.htmlClass : 'flex-100'}} schema-form-select " sf-layout>
<md-autocomplete flex
sf-messages
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}"
ng-disabled="form.readonly"
ng-model="$$value$$"
sf-autocomplete
sf-field-model="replaceAll"
sf-changed-auto-complete="form"
schema-validate="form"
md-selected-item="$$value$$"
md-search-text="searchText"
md-selected-item-change="'todo';"
md-items="item in evalExpr('this[\\''+form.optionFilter+'\\'](\\''+searchText+'\\')')"
md-item-text="item.name"
md-floating-label="{{::form.title}}"
md-menu-class="autocomplete-custom-template"
>
<md-item-template>
<span md-highlight-text="searchText">{{item.name}}</span>
</md-item-template>
<md-not-found>
No matches found
</md-not-found>
</md-autocomplete>
</div>
from angular-schema-form-material.
Thanks @brianpkelley back from holiday so I'll try to sort it out soon, yes autocomplete was the least finished of all the components, really hacked together for my own project at the time.
from angular-schema-form-material.
Related Issues (20)
- angular-material: breaking formatting changes HOT 2
- Understanding how to present the user with the ng-message HOT 4
- Release NPM HOT 3
- Bower registry problem HOT 5
- Datepicker always invalid HOT 6
- Inacurate textarea maxlength error HOT 2
- Some elements cannot be flex containers HOT 1
- Error message issues - with fixes
- Checkbox not rendering correctly on load HOT 3
- How to extend this decorator HOT 2
- model with previus data not showing correctly HOT 4
- Form Action Buttons not responding to onClick HOT 2
- Validation error messages are not displayed.
- Inputs doesn't show model values until click in input HOT 1
- Form Action Button "onClick" not responding to method in component.
- md-datepicker
- md-select: dynamic options
- Flex layout
- md-textarea: add rich text editor support (add-on?)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-schema-form-material.