title: Cannot list Ad Accounts in facebook app
body: <p>I'm developing a pure-html/js web application (actually I'm using AngularJS; with "pure" I mean: I'm not using any server side technology) which uses a Facebook-Connect button like this:</p>
  
  <pre><code>&lt;fb:login-button max_rows="1" size="xlarge" scope="email,public_profile,ads_management" show_faces="false" auto_logout_link="false"&gt;&lt;/fb:login-button&gt;
  </code></pre>
  
  <p>Such button asks for permission: <code>ads_management</code> and basic user data. I'm testing ad-management functionality.</p>
  
  <p>However, I ask two queries to facebook inside a controller:</p>
  
  <pre><code>$scope.fetchData = function() {
      FB.api('/me', function(response){
          $scope.$apply(function(){
              console.log("InApp::fetchData()");
              console.log(response);
              console.log("~InApp::fetchData()")
          });
      });
  };
  $scope.fetchAccounts = function() {
      FB.api('/me/adaccounts', function(response){
          $scope.$apply(function(){
              console.log("InApp::fetchAccounts()");
              console.log(response);
              console.log("~InApp::fetchAccounts()");
          });
      });
  };
  $scope.fetchAccountData = function(account_id) {
  
  };
  
  $scope.fetchData();
  $scope.fetchAccounts();
  </code></pre>
  
  <p>For narrow-purposes I just printed the contents of a controller. Assume such controller exists, requires the person is logged in Facebook, and the user is currently logged in.</p>
  
  <p><strong>My Issues are</strong>:</p>
  
  <ol>
  <li>The Login button does not update the page when I login. This is because no <code>onlogin=</code> was put. <strong>Question</strong>: How can I assign such attribute in an Angular way? (i.e. the handler coming from the scope).</li>
  <li><code>$scope.fetchData</code> is successfully executed. However, <code>$scope.fetchAccounts</code> is not. I'm asking this because I included the <code>ads_management</code> permission in the button. <strong>Question</strong>: What am I missing? (error: code: 10
  message: "(#10) You do not have sufficient permissions to perform this action"
  type: "OAuthException"). <strong>Edit - Additional notes</strong>: I deauthorized the application in my account, and reauthorized it: It never asks me the <code>ads_management</code> permission in the popup dialog.</li>
  </ol>