D
D
Dmitry2019-12-23 10:26:28
Dart
Dmitry, 2019-12-23 10:26:28

Adding and displaying an image?

Good day, I'm going through the tutorial on Angulardart (there is no such tag), and it became interesting how to expand the basic model presented in the tutorial, all my attempts to find this information failed, in the off.doc about displaying pictures = 0, tell me how to add a picture and then display it with the rest of the information?

class Hero {
  final int id;
  String name;
  Hero(this.id, this.name);
}

@Component(
  selector: 'my-app',
  template: '''
    <h1>{{title}}</h1>
    <h2>{{hero.name}}</h2>
    <div><label>id: </label>{{hero.id}}</div>
    <div>
      <label>name: </label>
      <input [(ngModel)]="hero.name" placeholder="name">
    </div>
  ''',
  directives: [formDirectives],
)
class AppComponent {
  final title = 'Tour of Heroes';
  Hero hero = Hero(1, 'Windstorm');
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Aksenov, 2019-12-24
@uberpwnr

What kind of image do you have?
As far as I know, you can insert an image or its base64 into the img url tag (as it is done in the application that the cli creates by default)
UPD: Here is more about base64 https://stackoverflow.com/a/50389079/2221639

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question