本文整理汇总了TypeScript中angular2/src/facade/lang.StringWrapper.contains方法的典型用法代码示例。如果您正苦于以下问题:TypeScript StringWrapper.contains方法的具体用法?TypeScript StringWrapper.contains怎么用?TypeScript StringWrapper.contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/lang.StringWrapper
的用法示例。
在下文中一共展示了StringWrapper.contains方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should support multiple instances polyfill-unscoped-rule', () => {
var css = s("polyfill-unscoped-rule {content: 'foo';color: blue;}" +
"polyfill-unscoped-rule {content: 'bar';color: blue;}",
'a');
expect(StringWrapper.contains(css, 'foo {;color:blue;}')).toBeTruthy();
expect(StringWrapper.contains(css, 'bar {;color:blue;}')).toBeTruthy();
});
示例2: it
it('should support toString', () => {
queryList.add('one');
queryList.add('two');
var listString = queryList.toString();
expect(StringWrapper.contains(listString, 'one')).toBeTruthy();
expect(StringWrapper.contains(listString, 'two')).toBeTruthy();
});
示例3: _colonHostContextPartReplacer
_colonHostContextPartReplacer(host, part, suffix) {
if (StringWrapper.contains(part, _polyfillHost)) {
return this._colonHostPartReplacer(host, part, suffix);
} else {
return host + part + suffix + ', ' + part + ' ' + host + suffix;
}
}
示例4: constructor
constructor(requestOptions: RequestOptions) {
// TODO: assert that url is present
let url = requestOptions.url;
this.url = requestOptions.url;
if (isPresent(requestOptions.search)) {
let search = requestOptions.search.toString();
if (search.length > 0) {
let prefix = '?';
if (StringWrapper.contains(this.url, '?')) {
prefix = (this.url[this.url.length - 1] == '&') ? '' : '&';
}
// TODO: just delete search-query-looking string in url?
this.url = url + prefix + search;
}
}
this._body = requestOptions.body;
this.method = requestOptions.method;
// TODO(jeffbcross): implement behavior
this.mode = requestOptions.mode;
// Defaults to 'omit', consistent with browser
// TODO(jeffbcross): implement behavior
this.credentials = requestOptions.credentials;
this.headers = new Headers(requestOptions.headers);
this.cache = requestOptions.cache;
}
示例5: _bindDirectiveEvent
_bindDirectiveEvent(eventName, action, compileElement, directiveBinderBuilder) {
var ast = this._parser.parseAction(action, compileElement.elementDescription);
if (StringWrapper.contains(eventName, EVENT_TARGET_SEPARATOR)) {
var parts = eventName.split(EVENT_TARGET_SEPARATOR);
directiveBinderBuilder.bindEvent(parts[1], ast, parts[0]);
} else {
directiveBinderBuilder.bindEvent(eventName, ast);
}
}
示例6: remove
remove(key: string) {
if (!StringWrapper.contains(key, '.')) {
return this._data.delete(key);
}
var pieces = key.split('.');
var last = ListWrapper.last(pieces);
pieces.length = pieces.length - 1;
var target = this._resolve(pieces, this);
return target.remove(last);
}
示例7: function
scoped = ListWrapper.map(parts, function(p) {
var t = StringWrapper.replaceAll(p.trim(), _polyfillHostRe, '');
if (t.length > 0 && !ListWrapper.contains(splits, t) && !StringWrapper.contains(t, attrName)) {
var re = RegExpWrapper.create('([^:]*)(:*)(.*)');
var m = RegExpWrapper.firstMatch(re, t);
if (isPresent(m)) {
p = m[1] + attrName + m[2] + m[3];
}
}
return p;
}).join(sep);
示例8: _scopeSelector
_scopeSelector(selector, scopeSelector, hostSelector, strict) {
var r = [],
parts = selector.split(',');
for (var i = 0; i < parts.length; i++) {
var p = parts[i];
p = p.trim();
if (this._selectorNeedsScoping(p, scopeSelector)) {
p = strict && !StringWrapper.contains(p, _polyfillHostNoCombinator) ? this._applyStrictSelectorScope(p, scopeSelector) : this._applySelectorScope(p, scopeSelector, hostSelector);
}
ListWrapper.push(r, p);
}
return r.join(', ');
}
示例9: expect
err => {
expect(StringWrapper.contains(err.message, 'did not invoke callback')).toBe(true);
async.done();
});