irontec / angular-bootstrap-simple-chat

Simple AngularJS Chat Directive with Bootstrap
147 stars 84 forks source link

How can I change the chat title? #11

Open tiagoovieira opened 8 years ago

tiagoovieira commented 8 years ago

The title of the chat is provided via a GET request, how can I update it?

aitorllj93 commented 8 years ago

Hi! I think something like this should work (not tried)

assign it to a variable in your controller like this:

function Controller($scope, $http) {
  $scope.chatTitle = ' ';
  $http.get('/api/config')
    .then(function(data) {
      $scope.chatTitle = data.title;
    }):
}

and set the variable to the title in the directive

<irontec-simple-chat  title="{{chatTitle}}""></irontec-simple-chat>