This repository has been archived by the owner on Jan 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(directive): Make translate-value-* work inside ng-if and ng-repeat
Closes Issue #433
- Loading branch information
1 parent
877b4fe
commit e07eea7
Showing
2 changed files
with
25 additions
and
5 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 |
---|---|---|
|
@@ -329,6 +329,21 @@ describe('pascalprecht.translate', function () { | |
$rootScope.$digest(); | ||
expect(element.text()).toEqual('hello my name is Glenn Jorde.'); | ||
}); | ||
|
||
// addresses [issue #433](https://github.com/angular-translate/angular-translate/issues/433) | ||
it('should interpolate variables inside ng-if directives', function () { | ||
var markup = '<div ng-if="true"><p translate="FOO" translate-value-name="{{name}}"></p></div>'; | ||
element = $compile(markup)($rootScope); | ||
$rootScope.$digest(); | ||
expect(element.next().text()).toEqual('hello my name is Pascal'); | ||
}); | ||
|
||
iit('should interpolate variables inside ng-repeat directives', function () { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tspaeth
Member
|
||
var markup = '<div><div ng-repeat="i in [1]"><p translate="FOO" translate-value-name="{{name}}"></p></div></div>'; | ||
element = $compile(markup)($rootScope); | ||
$rootScope.$digest(); | ||
expect(element.children().text()).toEqual('hello my name is Pascal'); | ||
}); | ||
}); | ||
|
||
describe('translate sanitization', function () { | ||
|
iit ? with two i ?