这是我的案例场景:
$auth.isAuthenticated() != true他们未登录进行识别,并将其重定向到/ login我会喜欢上这个第三步做的就是将其重定向到/设置页面,而不是主页.
我想我会改变这个变量:
$authProvider.loginRedirect = '/';
问题是,我可以不包括$authProvider在我的loginCtrl.js文件,而无需在我的控制台得到一个"未知供应商"的错误:https://docs.angularjs.org/error/?$喷油器/ unpr P0 =换句话说,角度不承认$authProvider时我试着把它包括在内.这是我的loginCtrl.js文件的样子:
/* Everything is blowing up because I'm trying to include $authProvider */
angular.module("PrayerChain")
.controller("loginCtrl", ["$rootScope", "$scope", "$state", "$http", "$auth", "$authProvider", loginCtrl]);
function loginCtrl($rootScope, $scope, $state, $http, $auth, $authProvider) {
$authProvider.loginRedirect = '/settings';
$scope.login = function () {
$auth.login({ Email: $scope.email, Password: $scope.password })
.then(function() {
})
.catch(function (response, status, headers) …Run Code Online (Sandbox Code Playgroud) 我试图关注https://github.com/GitbookIO/gitbook,但有一些假设的知识显然我没有.我已经使用过GitHub一段时间,但我还有很多需要学习的地方.
我的目标是在http://martynchamberlin.github.io/GitBook/ 上有一个与此存储库对应的GitHub页面:https://github.com/martynchamberlin/GitBook.
所以这是我的问题:GitBook究竟是如何做到这一点的?
我假设(虽然它没有说明)他们手动创建一个gh-pages分支,因为这神奇地将Github repo变成了Github页面.
要做到这一点,我已经关注了https://help.github.com/articles/creating-project-pages-manually上的Github文档
但这是我的问题:所有HTML(index.html等)都位于/ _book /而不是gh-pages分支的父目录中.这意味着当我加载https://github.com/martynchamberlin/GitBook时,我得到的是404.
请注意,当我在gitbook serve本地运行时,我会看到当我在localhost:4000启动浏览器时我应该做什么.
我确定我在这里错过了一些简单的东西.有任何想法吗?
谢谢,马丁