AngularJS $scope not showing value

809 views angularjs
0

I'm using flask(version 1.0.2) and AngularJS (version 1.7.2) material (version 1.1.10).

Problem is the controller is attached to view and it working, but just not showing value in view.

The controller

$$.controller("bigLayoutToolbarController", function ($scope) {
    $scope.title = "---"
    console.log(">>", $scope.title)
})

Surprisingly the console logging is working.

>> ---

The view

<section layout="row" flex  ng-controller="bigLayoutToolbarController">
<h2 flex md-truncate>{{ title }}</h2>
</section>

What am i wrong?

answered question

as i see nothing is wrong, can you show the full code?

@Sajeetharan That is almost full code bro.

1 Answer

9

Try removing the md-truncate because it will will automatically clip text which is wider than the component.

DEMO

var app = angular.module('myApp',[]);
app.controller("bigLayoutToolbarController", function ($scope) {
    $scope.title = "---"
    console.log(">>", $scope.title)
})
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular.min.js"></script>
<body ng-app="myApp">
<section layout="row" flex style="height: 100%" ng-controller="bigLayoutToolbarController">
<h2 flex md-truncate>{{ title }}</h2>
</section>
</body>

posted this

Have an answer?

JD

Please login first before posting an answer.