Skip to content

Commit c8ed3dd

Browse files
Merge pull request #10 from jagdeepsingh91/Dev
updated readme file
2 parents 0407b45 + 7e4fb23 commit c8ed3dd

2 files changed

Lines changed: 39 additions & 10 deletions

File tree

.travis.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
language: node_js
2-
node_js:
3-
- "4.1"
4-
- "4.0"
5-
- "0.12"
6-
- "0.11"
7-
- "0.10"
8-
- "0.8"
9-
- "0.6"
10-
- "iojs"

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,45 @@ selectedList = [
114114
</form>
115115
```
116116

117+
4. Fetching options list from 3rd party api/url
118+
Part 1. If your Api return an array of strings like :
119+
```javascript
120+
[
121+
"Java",
122+
"C",
123+
"C++",
124+
"AngularJs",
125+
"JavaScript"
126+
]
127+
```
128+
Then in html no need to specify property in "object-property" attribute in directive
129+
```html
130+
<multiple-autocomplete ng-model="skillsFromApi"
131+
api-url="{{apiPath}}"
132+
suggestions-arr="">
133+
</multiple-autocomplete>
134+
```
135+
136+
Part 2. If your Api return an array of objects like :
137+
```javascript
138+
[
139+
{id: 1, name : "Java"},
140+
{id: 2, name : "C"},
141+
{id: 3, name : "C++"},
142+
{id: 4, name : "AngularJs"},
143+
{id: 5, name : "JavaScript"}
144+
]
145+
```
146+
Then in html you need to specify property in "object-property" attribute in directive
147+
Here in this case, you have to do like this :
148+
```html
149+
<multiple-autocomplete ng-model="skillsFromApi"
150+
object-property="name"
151+
api-url="{{apiPath}}"
152+
suggestions-arr="">
153+
</multiple-autocomplete>
154+
```
155+
117156
For any suggestions, issues, Query, etc. Please feel free to let me know. Thanks :)
118157

119158

0 commit comments

Comments
 (0)