Question: Need to scroll dialog to top so that alert comes into view after form submission. 
Tried this but doesn't seem to work on dialogs.

```
window.scrollTo(0,0);

```

Answer: 
```js
document.getElementById('formsubmit').onclick=function(){
  document.getElementById('form').scrollTop = 0;
  return false;
}
```

```css
input {
  display:block;
}

.form {
  height:100px;
  overflow-y:auto;
}
```

```html
<div>
  <h1>form</h1>
  <div class="form" id="form">
    <input type="text">
    <input type="text">
    <input type="text">
    <input type="text">
    <input type="text">
    <input type="text">
    <input type="text">

    <input type="submit" id="formsubmit">
  </div>
</div>
```
Use the plain js `scrollIntoView` [1]

```
function scrollIntoView() {
  $('#modalId')[0].scrollIntoView();
}

```

Not an angular way but it works.

[1] <https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView>