-
Notifications
You must be signed in to change notification settings - Fork 723
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #993 from marmelab/submit_button_directive
[RFR] Add submit button directive
- Loading branch information
Showing
4 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Save button | ||
* | ||
* Usage: | ||
* <ma-submit-button label="Save changes"></ma-submit-button> | ||
*/ | ||
export default function maSubmitButtonDirective() { | ||
return { | ||
restrict: 'E', | ||
scope: { | ||
label: '@', | ||
}, | ||
link: function (scope) { | ||
scope.label = scope.label || 'Save'; | ||
}, | ||
template: '<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span> {{ label }}</button>' | ||
}; | ||
} | ||
|
||
maSubmitButtonDirective.$inject = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters