Skip to content

Commit f08bccf

Browse files
committed
Updated tabarray doc
1 parent 008c198 commit f08bccf

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

docs/index.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,10 +1108,56 @@ dependency [bootstrap-vertical-tabs](https://github.com/dbtek/bootstrap-vertical
11081108
It is not needed for tabs on top.
11091109
11101110
The `title` option is a bit special in `tabarray`, it defines the title
1111-
of the tab and is considered a angular expression. The expression is evaluated
1111+
of the tab and it is interpolated so you can use expression it. Its interpolated
11121112
with two extra variables in context: **value** and **$index**, where **value**
11131113
is the value in the array (i.e. that tab) and **$index** the index.
11141114
1115+
You can include multiple expressions or mix expressions and text as needed:
1116+
Ex:
1117+
```javascript
1118+
1119+
{
1120+
"form": [
1121+
{
1122+
"type": "tabarray",
1123+
"title": "My {{ value.name }} is:",
1124+
}
1125+
]
1126+
}
1127+
1128+
```
1129+
1130+
#### Deprecation Warning
1131+
Before version 0.8.0 the entire title was evaluated as an expression and not interpolated.
1132+
If you weren't using expressions in your form titles then no changes are needed.
1133+
1134+
However, if your tabarray titles contain implicit Angular expressions like this:
1135+
```js
1136+
{
1137+
"form": [
1138+
{
1139+
"type": "tabarray",
1140+
"title": "value.name || 'Tab '+$index",
1141+
}
1142+
]
1143+
}
1144+
```
1145+
1146+
1147+
Then you should change this to explicit expressions by wrapping them with the Angular expression
1148+
delimiter "{{ }}":
1149+
```js
1150+
{
1151+
"form": [
1152+
{
1153+
"type": "tabarray",
1154+
"title": "{{ value.name || 'Tab '+$index }}",
1155+
}
1156+
]
1157+
}
1158+
```
1159+
1160+
11151161
Example with tabs on the top:
11161162
11171163
```javascript
@@ -1143,7 +1189,7 @@ function FormCtrl($scope) {
11431189
{
11441190
type: "tabarray",
11451191
tabType: "top",
1146-
title: "value.nick || ('Tab '+$index)"
1192+
title: "{{value.nick || ('Tab '+$index)}}"
11471193
key: "subforms",
11481194
remove: "Delete",
11491195
style: {

0 commit comments

Comments
 (0)