Skip to content

Commit

Permalink
feat(dom): implement createAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenVinke committed Jul 23, 2017
1 parent d8e6239 commit e926bd9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export interface IDom {
*/
createElement(tagName: string): Element;
/**
* Creates the specified HTML attribute
* @param name A string that specifies the name of attribute to be created.
* @return The created attribute.
*/
createAttribute(name: string): Attr;
/**
* Creates a new Text node.
* @param text A string to populate the new Text node.
* @return A Text node.
Expand Down
3 changes: 3 additions & 0 deletions src/nodejs-dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export class NodeJsDom implements IDom {
createElement(tagName: string): Element {
return this.global.document.createElement(tagName);
}
createAttribute(name: string): Attr {
return this.global.document.createAttribute(name);
}
createTextNode(text: string): Text {
return this.global.document.createTextNode(text);
}
Expand Down

0 comments on commit e926bd9

Please sign in to comment.