Skip to content
This repository has been archived by the owner on Jan 22, 2018. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kisiela committed Nov 27, 2015
2 parents 3f5be21 + df52921 commit 0b7b5cc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.6.0] - 2015-11-27
### Added
- compatibility with Meteor releases lower then 1.2

## [0.5.2] - 2015-11-19
### Fixed
- missing md-theme attribute when using templateOptions.theme
Expand Down Expand Up @@ -70,6 +74,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## 0.0.1 - 2015-11-06

[0.6.0]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.5.2...v0.6.0
[0.5.2]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.5.1...v0.5.2
[0.5.1]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/wieldo/angular-formly-templates-material/compare/v0.4.0...v0.5.0
Expand Down
2 changes: 1 addition & 1 deletion lib/client/formly-material.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function formlyMaterial() {
var self = this;

this.templateUrl = function (templateUrl) {
return '/packages/wieldo:angular-formly-templates-material/' + templateUrl.replace(/^\//, "");
return angularTemplateUrl('wieldo:angular-formly-templates-material', templateUrl);
};

this.$get = function () {
Expand Down
4 changes: 2 additions & 2 deletions lib/client/wrappers/messages/messages.ng.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<formly-transclude></formly-transclude>
<div ng-messages="fc.$error">
<div ng-repeat="(name, message) in ::options.validation.messages"
ng-if="showError"
ng-message={{::name}}>{{message(fc.$viewValue, fc.$modelValue, this)}}
ng-message-exp="name">
{{message(fc.$viewValue, fc.$modelValue, this)}}
</div>
</div>
5 changes: 4 additions & 1 deletion package.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var client = 'client';
Package.describe({
name: "wieldo:angular-formly-templates-material",
summary: "Material design templates for angular-formly",
version: "0.5.2",
version: "0.6.0",

documentation: 'README.md',
git: 'https://github.com/wieldo/angular-formly-templates-material.git'
Expand All @@ -14,11 +14,13 @@ Package.onUse(function (api) {
var packages = {
use: [
'[email protected]',
'mys:[email protected]',
'pbastowski:[email protected]',
'pbastowski:[email protected]',
'wieldo:[email protected]'
],
imply: [
'mys:angular-template-url',
'angular:[email protected]',
'angular:[email protected]',
'angular:[email protected]',
Expand Down Expand Up @@ -110,6 +112,7 @@ Package.onTest(function(api) {
'velocity:helpers',
'velocity:console-reporter',
'jquery',
'mys:version-compare',
'angular:[email protected]',
'wieldo:angular-formly-templates-material'
]);
Expand Down
27 changes: 15 additions & 12 deletions tests/client/formly-material-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,48 @@ describe('formlyMaterial', () => {
//
let formlyMaterial;
let formlyMaterialPr;
let prefix;

//
// tests
//

beforeEach(() => {
angular.module('formlyMaterialMock', [])
.config((formlyMaterialProvider) => {
formlyMaterialPr = formlyMaterialProvider
});
module('formlyMaterial', 'formlyMaterialMock');

angular.module('testApp', ['angular-meteor', 'formly', 'formlyMaterial', 'ngMock']);
module('testApp');

inject(function ($templateCache, $httpBackend, _formlyMaterial_) {
$httpBackend.whenGET(/\.html$/i).respond((method, url) => $templateCache.get(url));
formlyMaterial = _formlyMaterial_;
});

if (meteorVersionCompare.lt('1.2')) {
prefix = "/packages/wieldo_angular-formly-templates-material_";
} else {
prefix = "/packages/wieldo:angular-formly-templates-material/";
}
});

it("should be injectable", () => {
expect(formlyMaterial).toBeDefined();
});

it("should be able to add prefix to templateUrl using factory", () => {
const prefix = "/packages/wieldo:angular-formly-templates-material/";

expect(formlyMaterial.templateUrl("test.html")).toBe(prefix + "test.html");
expect(formlyMaterial.templateUrl("/test.html")).toBe(prefix + "test.html");
expect(formlyMaterial.templateUrl("/test/test.html")).toBe(prefix + "test/test.html");
expect(formlyMaterial.templateUrl("client/test.html")).toBe(prefix + "client/test.html");
expect(formlyMaterial.templateUrl("/client/test.html")).toBe(prefix + "client/test.html");
expect(formlyMaterial.templateUrl("/client/test/test.html")).toBe(prefix + "client/test/test.html");
});

it("should be able to add prefix to templateUrl using provider", () => {
const prefix = "/packages/wieldo:angular-formly-templates-material/";

expect(formlyMaterialPr.templateUrl("test.html")).toBe(prefix + "test.html");
expect(formlyMaterialPr.templateUrl("/test.html")).toBe(prefix + "test.html");
expect(formlyMaterialPr.templateUrl("/test/test.html")).toBe(prefix + "test/test.html");
expect(formlyMaterialPr.templateUrl("client/test.html")).toBe(prefix + "client/test.html");
expect(formlyMaterialPr.templateUrl("/client/test.html")).toBe(prefix + "client/test.html");
expect(formlyMaterialPr.templateUrl("/client/test/test.html")).toBe(prefix + "client/test/test.html");
});

});

0 comments on commit 0b7b5cc

Please sign in to comment.