当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript StringWrapper.contains方法代码示例

本文整理汇总了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();
 });
开发者ID:TedSander,项目名称:angular,代码行数:7,代码来源:shadow_css_spec.ts

示例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();
 });
开发者ID:lavinjj,项目名称:angular,代码行数:7,代码来源:query_list_spec.ts

示例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;
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:7,代码来源:shadow_css.ts

示例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;
 }
开发者ID:goderbauer,项目名称:angular,代码行数:25,代码来源:static_request.ts

示例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);
   }
 }
开发者ID:baraksu,项目名称:angular,代码行数:9,代码来源:directive_parser.ts

示例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);
 }
开发者ID:1186792881,项目名称:angular,代码行数:10,代码来源:common.ts

示例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);
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:11,代码来源:shadow_css.ts

示例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(', ');
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:13,代码来源:shadow_css.ts

示例9: expect

 err => {
   expect(StringWrapper.contains(err.message, 'did not invoke callback')).toBe(true);
   async.done();
 });
开发者ID:goderbauer,项目名称:angular,代码行数:4,代码来源:jsonp_backend_spec.ts


注:本文中的angular2/src/facade/lang.StringWrapper.contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。