Question: I have the following code. The issue is it isnt showing either view. What am i doing wrong? 

```
.state('app.accessmanager.user.reactivate', {

    url: '/reactivate',
    Views: {
        '': {templateUrl: 'assets/views/accessmanager/reactivate.html'},
        title: 'ReActivate User',
        icon: 'ti-layout-media-left-alt',
        ncyBreadcrumb: {
            label: 'ReActivate User'
        },
        'sideBar': {templateUrl: 'assets/views/partials/AMSidebar.html'}
        }

```

here is the markup. 

```html
<div class="sidebar app-aside" id="sidebar" toggleable parent-active-class="app-slide-off" >
    <div perfect-scrollbar wheel-propagation="false" suppress-scroll-x="true" class="sidebar-container">
        <div ui-view="sideBar"></div>
    </div>
</div>
<div class="app-content" ng-class="{loading: loading}">
 <header data-ng-include=" 'assets/views/partials/top-navbar.html' " class="navbar navbar-default navbar-static-top"></header>
 <div data-ng-include=" 'assets/views/partials/main-content.html' " class="main-content" ></div>
</div>
```

if I do the following, it will at least display the sidebar but not the main content.

```
.state('app.access', {
    url: '/access',
        views: {
            'sideBar': {
                templateUrl: 'assets/views/partials/AMSidebar.html'
            }
        },
    template: '<div ui-view class="fade-in-up"></div>',
    title: 'ACCESS MANAGER',
    ncyBreadcrumb: {
        label: 'ACCESS MANAGER'
    }
})

```

Answer: 
You can use regex:

```
var tel = "123457890";
if (!tel.match(/^\d{10}$/)) {
    console.log("Sorry, incorrect format.");
} else {
    var areaCode = tel.substring(0,3);
    var prefix = tel.substring(3,6);
    var suffix = tel.substring(6,10);
    console.log("(" + areaCode + ") " + prefix + "-" + suffix);
}

```
This works. It deletes all letters and checks if the length changes

```js
var tel = "1234567890";
if (tel.length !== 10 || tel.length !== parseInt(tel).toString().length) {
    document.write("Sorry, incorrect format.");
} else {
    var areaCode = tel.substring(0,3);
    var prefix = tel.substring(3,6);
    var suffix = tel.substring(6,10);
    document.write("(" + areaCode + ") " + prefix + "-" + suffix);
}
```