Check this post Using OAuth2 in HTML5 Web App. @jandersen answer gives a good explanation on using Resource owner password credentialsResource owner password credentials flow in single page applications. In any case, the prefered flow for this apps should be the Implicit grantImplicit grant. In fact, @jandersen 's response on the referenced post is about tweaking Resource owner password credentials to act as something close to the Implicit grant.
replaced http://tools.ietf.org/html/rfc with https://www.rfc-editor.org/rfc/rfc