# View-title not working in element directive body

**URL:** <https://forum.ionicframework.com/t/view-title-not-working-in-element-directive-body/17891>\
**Category:** ionic-v1\
**Created:** [February 19, 2015, 5:01pm UTC](https://forum.ionicframework.com/t/view-title-not-working-in-element-directive-body/17891 "2015-02-19T17:01:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trazek](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@trazek](https://forum.ionicframework.com/u/trazek)\
**Post date:** [February 19, 2015, 5:01pm UTC](https://forum.ionicframework.com/t/view-title-not-working-in-element-directive-body/17891/1 "2015-02-19T17:01:34Z")

</div>

Consider the following:

```
...
$stateProvider
.state("root", {
	abstract: true,
	template: "<ion-nav-bar></ion-nav-bar><ion-nav-view name='root'></ion-nav-view>"
})
.state("root.child", {
	url: "/child",
	views: {
		"root": {
			template: "<child-state></child-state>"
		}
	}
});
...

```

Where the contents of “`<child-state></child-state>`” is:

```
<ion-view view-title="MY TITLE">
	<ion-content>
		<span>HELLO WORLD</span>
	</ion-content>
</ion-view>

```

Give this setup, `view-title="MY TITLE"` doesn’t work and the `<ion-nav-bar></ion-nav-bar>` on the root state does not get affected. However if I change the template of `root.child` to the following, it works:

```
...
template: "<ion-view view-title='MY TITLE'><child-state></child-state></ion-view>"
...

```

I have even tried setting `replace: true` on the `<child-state></child-state>` and the `view-title` still didn’t work.

Why wouldn’t the `view-title` be set in my original setup?
