stories2
stories2

Reputation: 486

AngularJS $scope not showing value

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 style="height: 100%" ng-controller="bigLayoutToolbarController">
<h2 flex md-truncate>{{ title }}</h2>
</section>

What am i wrong?

Upvotes: 0

Views: 46

Answers (1)

Sajeetharan
Sajeetharan

Reputation: 222522

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>

Upvotes: 1

Related Questions