Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ayo Adesina 419 posts 1001 karma points
    Oct 15, 2017 @ 14:44
    Ayo Adesina
    0

    $scope and VM are undefined In console - Why?

    I'm creating a back end custom section, genrally in my controllers I am using the this key word and assigning it to VM

    var vm = this;
    

    Then inside my HTML views I am delearing my controllers like this:

    <div ng-controller="ControllerName as vm">
    

    But I have been wondering why when I call

    $scope or vm in the console it turns out to be undifined.

    Can anyone explain this to me?

  • Ayo Adesina 419 posts 1001 karma points
    Oct 15, 2017 @ 15:27
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies