Problem with ui-router in Angularjs

Asked

Viewed 23 times

1

I’m in Trouble when I’m trying to make a GET on the API to get information. The problem is that the webserver is not Calling the API. I must Fill in the ng -model field named.

The following part of the code APP.js.

  .state('highways.id', {
        url: '/edit/:id',
        templateUrl: 'assets/templates/highway/edit.html',
        controller: 'HighwayController as ctrl')}

The following part of the code Edit.html.

<div class="form-group">
                        <label class="col-sm-2 control-label">Rodovia:</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="inputText1" name="highway" ng-model="name" required>
                            <span class="help-inline" ng-show="validation.highway.$error.required"></span>
                        </div>
                    </div>

API

[HttpGet]
public Highway Get(int id)
{
    HighwayEntity high = new HighwayEntity(id);
    Highway highmap = new Highway();
    highmap.InjectFromEntity(high);
    return highmap;

}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.