Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lib): allow img attributes #111

Merged
merged 14 commits into from
Sep 14, 2018

Conversation

jamesatfish
Copy link
Contributor

Added support to pass through style attributes to the generated tag.

Please feel free to amend / request changes as appropriate - I am primarily a Swift dev and this is my first ionic / typescript PR.

@danielsogl danielsogl self-assigned this Jul 25, 2018
@danielsogl danielsogl added this to the 6.0.0 milestone Jul 25, 2018
@danielsogl
Copy link
Contributor

Please rebase your PR on master

@danielsogl danielsogl changed the title Feature/img attributes feat(lib): allow img attributes Sep 11, 2018
@@ -0,0 +1,12 @@
class IonicImageLoaderController {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this file

README.md Outdated

2. Generate an array of ImageAttribute objects
```typescript
var imageAttributes: ImageAttribute[] = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const instead of var

@@ -0,0 +1,4 @@
export class ImageAttribute {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an interface

@@ -185,6 +212,10 @@ export class ImgLoader implements OnInit {
// set it's src
this._renderer.setElementAttribute(this.element, 'src', imageUrl);

// if imgAttributes are defined, add them to our img element
this.imgAttributes.forEach((attribute, index, attributeArray) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This should only run if useImg is set to true
  • attributeArray is not needed

@madoBaker madoBaker merged commit 482f6b5 into zyra:master Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants