This file contains hidden or 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
import { | |
DocumentReference, | |
type DocumentData, | |
DocumentSnapshot, | |
onSnapshot, | |
Query, | |
QuerySnapshot, | |
getDoc, | |
getDocs | |
} from 'firebase/firestore'; |
This file contains hidden or 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
// set your term | |
// return this.options to your template | |
// see here: https://fireblog.io/blog/post/firestore-full-text-search | |
const n: any = term.split(' ').length; | |
// split words for separate searching... | |
let newTerm: string[] = term.split(' '); | |
// add each word to search term |
This file contains hidden or 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
// put all of this in a callable angular function | |
// for searching | |
// set this.options: Observable<any> | |
// use that in your template | |
// get the term from your form control in lowercase | |
const term = this.myForm.get('term')?.value.toLowerCase(); | |
// set your collection | |
const col = 'posts'; |
This file contains hidden or 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
/* | |
* Author: Jonathan Gamble | |
* jQuery UI Theme Changer | |
*/ | |
$(document).ready(function() { | |
// id of your theme selector <div> | |
themeSelector('#themeSelector'); |