Ändern Sie die Textfarbe mit AngularJsJava

Java-Forum
Anonymous
 Ändern Sie die Textfarbe mit AngularJs

Post by Anonymous »

Ich habe diesen Teilcode: < /p>

Code: Select all

     ng-class="{'color-red': $ctrl.clientStatus === 'Error', 'color-blue': $ctrl.clientStatus === 'Warning', 'color-green': $ctrl.clientStatus === 'OK'}">
Status: {{$ctrl.filesToUploadClientStatus}}
< /code>

Und dieser Komponentencode: < /p>

(function (app) {
app.component('uploadFilesComponent', {
templateUrl: 'partials/upload-files-partial.html',

// bindings: {filesToUpload: '=', hasFilesOnServer : '='},
controller: ['$scope', '$state','uploadService', function ($scope, $state, uploadService) {

...

var self = this;

var NO_FILES_TO_UPLOAD = "No files to upload";
var WAITING_FOR_UPLOAD = "Waiting for upload";

self.clientStatus = self.filesToUploadClientStatus.contains(WAITING_FOR_UPLOAD) ? 'OK' : 'Error';
...
}
< /code>

Warum erhalte ich beim Hinzufügen eines HTML? < /p>

ng-class="{'color-red': $ctrl.clientStatus === 'Error', 'color-blue': $ctrl.clientStatus === 'Warning', 'color-green': $ctrl.clientStatus === 'OK'}">
Status: {{$ctrl.filesToUploadClientStatus}}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post