karma AngularJS

12 views
Skip to first unread message

marc

unread,
Mar 16, 2018, 5:19:42 AM3/16/18
to Angular and AngularJS discussion
Hi all,
I have a problem with karma. I have to test a method on controller that runs a dependence injection.

  $ctrl.load = () => {
    model.load($ctrl.accountId)
      .then(data => {
        $ctrl.data = data;
      })
  }

model.load is a dependency ("export default function TestController(model))"

When I run my test, for example: ctrl.load(), it failure because model is not defined.
How I run $ctrl.load and read from file spec $ctrl.data ?
I am very confused!
Tnx!

marc

unread,
Mar 20, 2018, 3:22:14 AM3/20/18
to Angular and AngularJS discussion
nobody who can explain me?
Reply all
Reply to author
Forward
0 new messages