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

What am i wrong?

2
  • as i see nothing is wrong, can you show the full code? Commented Sep 16, 2018 at 3:31
  • @Sajeetharan That is almost full code bro. Commented Sep 16, 2018 at 3:34

1 Answer 1

1

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>

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

10 Comments

it should work unless if you are doing some other mistake. see the demo
yea i know it must be work. but i don't know why it happens
try to reproduce your issue with plunker, i am sure something wrong with your code
Sajeetharan, you're using the wrong version of angularjs. not sure if this actually matters.
what is the version you are using
|

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.