我使用带有angualrjs的nodewebkit并且我对routeProvider有一些问题,这个简单的例子在浏览器中运行正常但是当我使用nodewebkit并点击一些带有链接到路由器的链接时,这什么都不做< / p>
var musicPlayer = angular.module("musicPlayer", ["ngRoute"]);
musicPlayer.config(function($routeProvider, $locationProvider){
$routeProvider.
when("/",{
templateUrl: "/app/views/albums.html",
controller: "indexCtrl"
}).
when("/album/:id", {
templateUrl: "/app/views/album.html",
controller: "albumCtrl"
}).
otherwise({
redirectTo: "/parking"
});
});
musicPlayer.controller("indexCtrl", function($scope){
var albums = [
{
id: 1,
band: "megadeth",
name: "Rust in peace"
},
{
id: 2,
band: "megadeth",
name: "Peace sells"
}
];
$scope.albums = albums;
});
musicPlayer.controller("albumCtrl", function($scope){
console.log("album")
});
在nodewebkit devtools中从ng创建ng-repeat创建此网址不安全:app://host/app/views/index.html#/album/1 任何想法?
AngularJS v1.2.0
好吧,我修复了在配置
中添加它的问题 // Add app: protocol for node-webkit
.config(['$compileProvider', function($compileProvider) {
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|app):/);
}]);