Javascript ngRoute不';好像不行。角度1.5.7
我知道在这个主题上有一些问题,但没有一个主题帮助我解决了我的问题 我有: -404错误 -browserLink:37[Deprecation]主线程上的同步XMLHttpRequest已被弃用,因为它会对最终用户的体验产生有害影响。如需更多帮助,请查看。警告 html: 1文件Javascript ngRoute不';好像不行。角度1.5.7,javascript,angularjs,Javascript,Angularjs,我知道在这个主题上有一些问题,但没有一个主题帮助我解决了我的问题 我有: -404错误 -browserLink:37[Deprecation]主线程上的同步XMLHttpRequest已被弃用,因为它会对最终用户的体验产生有害影响。如需更多帮助,请查看。警告 html: 1文件 angular.module('app').controller('FirstController', function () { }); 2文件 angular.module('app').controller('
angular.module('app').controller('FirstController', function () { });
2文件
angular.module('app').controller('parkingCtrl', ['$rootScope', '$scope', '$routeParams',
function ($rootScope, $scope, $routeParams) {
}]);
花了整个周末的时间试图找出路线,开始绝望:)谢谢你的帮助。致以最良好的祝愿
vue:
<script type="text/ng-template" id="/locelec/voiturelist">
<div class="page page-dashboard ng-scope" ng-controller="parkingCtrl">
<div class="row">
<div class="col-md-12">
<h1>Voitures</h1>
</div>
</div>
<div class="row">
<div class="col-md-12">
<a class="btn btn-primary" role="button" href="#/bicycles/new">
Ajoutez nouveau voiture
</a>
</div>
</div>
<div class="row">
<div class="col-md-12">
</div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Id</th>
<th>Marque</th>
<th>Modele</th>
<th>Carburant</th>
<th>Numbre de Portes</th>
<th>Transmission</th>
<th>Consommation</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="vehicule in model.listvehicules | filter: {TypeVehicule : 'voiture'}">
<td>{{vehicule.Id}}</td>
<td>{{vehicule.Marque}}</td>
<td>{{vehicule.Modele}}</td>
<td>{{vehicule.Carburant}}</td>
<td>{{vehicule.NumPortes}}</td>
<td>{{vehicule.Transmission}}</td>
<td>{{vehicule.Consommation}}</td>
<!--<td>
<a class="btn btn-default" role="button"
ng-link="['VoitureEdit', {id: vehicule.Id}]">
Edit {{vehicule.Id}}
</a>
</td>-->
<td>
<a class="btn btn-default" role="button" ng-link="['VoitureEdit']">
Edit VoitureEdit
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</script>
Voitures
身份证件
品牌
莫代尔
增碳剂
门框
传输
联合体
{{vehicleue.Id}
{{车辆.品牌}
{{vehicleue.Modele}}
{{车辆化油器}
{{vehicleue.NumPortes}
{{车辆.变速箱}
{{车辆联合}
编辑VoitureEdit
关键问题是
<ng-view></ng-view>
失踪
在这个非常好的教程的帮助下,我意识到了这一点
谢谢大家 第一个不是控制器,而是模块。你不能把函数放进去。路线的模板文件呢?我认为你的模板URL不对,当(“/parking”,{templateUrl:”./app/voiture list.component.html),controller:“parkingCtrl”,})时试试这个
代码>它不工作。我在.NET MVC5中。请将“template”更改为“templateUrl”,并将正确的路径添加到html文档(app/path//locelec/voiturelist.html)。我从未尝试过按id绑定tempalte,这可能吗?在您看来,删除“ng controller=”parkingCtrl“,因为您已经在路由上定义了控制器。
<script type="text/ng-template" id="/locelec/voiturelist">
<div class="page page-dashboard ng-scope" ng-controller="parkingCtrl">
<div class="row">
<div class="col-md-12">
<h1>Voitures</h1>
</div>
</div>
<div class="row">
<div class="col-md-12">
<a class="btn btn-primary" role="button" href="#/bicycles/new">
Ajoutez nouveau voiture
</a>
</div>
</div>
<div class="row">
<div class="col-md-12">
</div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Id</th>
<th>Marque</th>
<th>Modele</th>
<th>Carburant</th>
<th>Numbre de Portes</th>
<th>Transmission</th>
<th>Consommation</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="vehicule in model.listvehicules | filter: {TypeVehicule : 'voiture'}">
<td>{{vehicule.Id}}</td>
<td>{{vehicule.Marque}}</td>
<td>{{vehicule.Modele}}</td>
<td>{{vehicule.Carburant}}</td>
<td>{{vehicule.NumPortes}}</td>
<td>{{vehicule.Transmission}}</td>
<td>{{vehicule.Consommation}}</td>
<!--<td>
<a class="btn btn-default" role="button"
ng-link="['VoitureEdit', {id: vehicule.Id}]">
Edit {{vehicule.Id}}
</a>
</td>-->
<td>
<a class="btn btn-default" role="button" ng-link="['VoitureEdit']">
Edit VoitureEdit
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</script>
<ng-view></ng-view>