Angular, ControllerAs not working

2 posts, 0 answers
  1. Alistair
    Alistair avatar
    8 posts
    Member since:
    May 2014

    Posted 05 Sep 2014 Link to this post

    I have an angular template with the following notification:

    <div kendo-notification="saveNotification">

    In the controller when the save button is clicked I have:

    $"Hello", "World");

    which works.  However, when I try and access the control via the ControllerAs syntax:

    var vm = this;;

    I get the error "Cannot read property "show" of undefined".

    Can you tell me what I am doing wrong?

  2. Mihai
    Mihai avatar
    153 posts

    Posted 09 Sep 2014 Link to this post


    The widget references are only exposed to the scope, so in order for that variable to get into your controller object you'll have to name it "main.notification".  Example:

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top