0

Seems like it'd be pretty straight forward but I am not able to get my text to display

In my HTML I have <td>{{cabinetDetails.cabinetType}}</td> and my data source is $scope.cabinetDetails = [{cabinetType: 'panel'}];

Nothing is displaying in my HTML. I've also tried: $scope.cabinetDetails = [{'cabinetType': 'panel'}];

Any ideas?

1 Answer 1

3

It would appear you have made an array of objects, so I think the code that would currently work is either:

<td>{{cabinetDetails[0].cabinetType}}</td>

Or replace

$scope.cabinetDetails = [{cabinetType: 'panel'}];

with

$scope.cabinetDetails = {cabinetType: 'panel'};
Sign up to request clarification or add additional context in comments.

3 Comments

Ahh duh. Ok I spaced on that. I'm going to do that last snippet. I'll accept you answer in 10 minutes
Good choice, because unless you plan on adding more objects to that array in the future, just use a plain object.
I definitely plan on adding more so that would be the wiser choice.

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.