I am using angular -ui-router. When the form is submitted, I want to activate ui-routing, which is defined using ui-sref= "url" There is no action element in Angularjs, so I use the ng-submit element.
How / where to define ui-sref ?
form usually has the following code. But the "url" below is not routed through ui-router.
form(name="LNquestionForm", action="/url")
I want to do something like
form(name="LNquestionForm", ng-submit='ui-sref = "url" ')
So, routing happens through myAngularApp.js as: -
var myApp = angular.module('myApp', ['ui.router']); myApp.config(function($stateProvider, $urlRouterProvider) { // Now set up the states $stateProvider .state('/url', { url: "/url", templateUrl: "partials/someLink" } })
source share