1

In my AngularJS Controller I got

        var test = {
            "type": "pie",
            "theme": "light",
            "data": dataWantedArea,
            "valueField": "value",
            "titleField": "name",
            "balloon": {
                "fixedPosition": true
            },
            "autoMargins": false,
            "marginLeft": 5,
            "marginRight": 5,
            "marginBottom": 5,
            "marginTop": 5,
            "pullOutRadius": 0,
            colors: ["#36CB1F", "#F58426", "#F53E26"],
            "export": {
                "enabled": true
            }
        };

in my template I do

<am-chart ng-if="test.data.length" id="test" options="test" width="90vw" height="325px"></am-chart>

Problem: its never shown, obviously test.data.length is ALWAYS false - so I would like to print some debugging in my template, is that possible somehow? Of course If you know a direct solution to my problem, feel free to answer.

2 Answers 2

4

If you want to use data or variable from controller to html, you have to use $scope.

Use $scope.test intead of var test

Sign up to request clarification or add additional context in comments.

Comments

3

To debug your code there is a cool browser plugin available.

http://ng-inspector.org/

There you can see a tree and all your values. It's very helpful to debug your code. You can see your scope and you can find and see problems.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.