https://github.com/billcheng/angular-search-text
Angular Search Text Box for Materialize
https://github.com/billcheng/angular-search-text
angularjs materialize-css
Last synced: 7 months ago
JSON representation
Angular Search Text Box for Materialize
- Host: GitHub
- URL: https://github.com/billcheng/angular-search-text
- Owner: billcheng
- License: mit
- Created: 2016-03-22T06:15:55.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-26T05:15:19.000Z (almost 10 years ago)
- Last Synced: 2025-02-06T23:05:05.283Z (about 1 year ago)
- Topics: angularjs, materialize-css
- Language: HTML
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular-search-text
Angular Search Text Box for Materialize
# Install
```code
bower install angular-search-text
```
# CSS
```html
```
# Script
```html
```
# Angular module
```javascript
angular.module("yourApp", ["ngSearchText"])
```
# HTML Tag
```html
```
# Example of ng-request function (local)
```javascript
$scope.doSearch = function(deferred, text) {
var result = [];
if (text!=='')
var lowerCaseText = text.toLowerCase();
angular.forEach(searchList, function(s){
if (s.toLowerCase().startsWith(lowerCaseText))
result.push(s);
});
deferred.resolve({data: result});
};
```
# Example of ng-request function (remote)
```javascript
$scope.doSearch = function(deferred, text) {
$http.get("webapi")
.then(function(response){
deferred.resolve({data: response.data});
},
function(response){
deferred.reject(response);
});
};
```