角度控制器问题

时间:2015-09-03 13:37:54

标签: angularjs angularfire angularjs-ng-route

我正在尝试使用angularFire通过Facebook和Twitter注册。 我有3个href,每个都应该有它的模板和控制器。 但是,当我单击使用Twitter注册时,模板会调用Twitter控制器和Facebook控制器,因为它应该只是调用twitter控制器。知道为什么会这样吗?

HTML

<div class="il signUpBox" ng-show="showSP">
    <a  href="#createProfileTwitter" role="button" class="btn btn-info" ng-click="loginTwitter()"> Sign up with Twitter</a></br>
    <a  href="#createProfileFacebok" role="button" class="btn btn-primary" ng-click="loginFacebook()">Sign up with Facebook</a></br>
    <a  href="#createProfile" role="button" class="btn btn-default" ng-click="CreateYourAccount()"> Create your Account</a>
</div>

JS

app.config(function($routeProvider){ $routeProvider
.when("/account", {
  templateUrl: "templates/signInView.html"
})
.when("/createProfileTwitter", {
  templateUrl: "templates/createProfileTwitter.html",
  controller: "AccControllerTwitter"
})
.when("/createProfileFacebook", {
  templateUrl: "templates/createProfileFacebook.html",
  controller: "AccControllerFacebook"
})
.otherwise({
  templateUrl: "templates/signInView.html",
}) })

0 个答案:

没有答案
相关问题